Logical Volume Manager or LVM is an awesome tool to bring new levels of flexibility to volumes. By abstracting the usage of block devices and partitions one can easily create, expand and move volumes with reduced system impace.

Creating a Volume Group

To use LVM the first step is to choose a true physical block device or volume (PV) to hold the Volume Group (VG). A VG is set of Logical Volumes (LV) made up from physical extends (PE), the LV is like a partition and contains the file-system (FS) This is an overly simplified description.

We'll start by choosing which the PV to hold our data, for the example it will be /dev/md0 a previously created software-raid device.

root@boron # pvcreate /dev/md0

Now we create the VG on this PV

root@boron # vgcreate vg0 /dev/md0

This volume group will show up as /dev/vg0.

Creating a Logical Volume

Once the PV and VG have been created we then make our logical volume(s).

root@boron # lvcreate --size 8G --name lv0 vg0

And view the created LV like so:

root@boron # lvscan 
root@boron # lvdisplay /dev/vg0/lv0

See Also