Setting up LVM Groups in Linux

Logical Group Manager (LVM) is a linux solution for spanning volumes over multiple disks. It’s similar to windows storage pools only LVM does not support RAID.

Assume we have 3 disks connected to our linux server with partitions and they are:

/dev/sdb1
/dev/sdc1
/dev/sdd1
Be sure there are no mounted volumes. If there are you will need to umount them before creating an LVM.

The three commands used in this process are:
pvcreate
vgcreate
lvcreate

To create a new LVM we type:

pvcreate /dev/sdb1 /dev/sdc1 /dev/sdd1

You can check the group created correctly by running:

vgdisplay

Next we need to create a “volume group”:

vgcreate bucket /dev/sdb1 /dev/sdc1 /dev/sdd1

lvcreate -L 22G -n company_volume bucket

Now that we’ve created a logical volume (this is like a virtual disk) we can now move on to make a filesystem on it (mkfs.ext4), which is actually layered over the three disks underneath.

This would never really be used in production as there is no fault tolerance for disk failure.

Leave a Reply

Your email address will not be published. Required fields are marked *