Skip to content

logical volume manager

Builds logical disk volumes on top of physical ones. Especially useful for resizing and reordering disks.

setup

I have 3 harddisk of 1 GB each, and combine these into one logical volume.

physical volumes

These are just LVM physical disks the size of the underlying hardware :

To prepare these for LVM, partition them as /dev/sdb1, /dev/sdc1 and /dev/sdd1 and give them type 8e (Linux LVM) Then make them physical volumes using pvcreate :

The reverse action would be pvremove pvdisplaym and pvs would show your volumes.

volume group

You can now bind physical volumes into a volume group.

vgcreate fileserver /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1

Again, useful commands are vgremove, vgdisplay, vgrename, and

logical volumes

Lvm it is called, and here they are. Let's create two logical volumes.

' lvcreate --name small --size 1G fileserver lvcreate --name big --size 1.8G fileserver '

There is probably some overhead since asking for 2G was too much, so i made 1.8G Listing these volumes can be done with lvs

Ok, there was another volume group already, you could do lvs fileserver to get only those LV's

using the volumes

Now they are just like normal partitions, reachable in /dev/. So

Format and mount :