If a Logical Volume Manager name contains a dash, then the /dev/mapper/ version of that name will replace any single dash with a double dash.
As Example:
If the Logical Volume Group is some-volume-group
& the Logical Volume is volume
:
/dev/some-volume-group/volume /dev/mapper/some--volume--group-volume
… are the 2 different ways in which that Logical Volume would exist in /dev .
This is why when I set names for a Logical Volume Group, and the Logical Volumes in that, I try to choose names that are short and to the point, made up of only letters and numbers.
sudo blkid
will show the UUID for both Drive Partitions and LVM Volumes.sudo fdisk -l
will list any Drive Partitions that contain a “Linux LVM”.sudo lvscan
, sudo lvs
or sudo lvdisplay
By default, installing Ubuntu will create a Swap Partition (/swap) that is the same size as the Physical Memory in the PC while Ubuntu is installing. Then the rest of the available drive space will be used for the Root Partition (/). When LVM has been used to install the operating system, it is possible to resize these partitions– to shrink the Root Partition by a few GB, then allocate that drive space to the Swap Partition.
Supposedly it is possible to expand an LVM Volume while it is in use. On the other hand, I expect that trying to shrink an LVM Volume while it is in use would amount to “just begging for trouble”. So in all cases, I try to “play it safe” by using Live Boot media when I want to resize anything.
/swap
, I boot from 12.04LTS based media, then install the LVM2 support.
$ sudo apt-get update $ sudo -i # apt-get install lvm2 # lvscan
For a standard install of Ubuntu Studio 14.04, the results are as follows: inactive '/dev/ubuntu-studio-vg/root' [xx.xxGiB] inherit inactive '/dev/ubuntu-studio-vg/swap_1' [x.xxGB] inherit
The next command will first shrink the filesystem, then shrink the Logical Volume, which is the only safe method to do this.
# lvreduce --resizefs --size -2GB /dev/ubuntu-studio-vg/root # lvexpand --size +2GB /dev/ubuntu-studio-vg/swap_1 # mkswap /dev/ubuntu-studio-vg/swap_1
The last command above remakes /swap – which permits it to use the full size of the larger Logical Volume.
#exit $ sudo reboot