LVM Pools

Guides in this Section

What is LVM?

Logical Volume Management is a method of partitioning disks, that removes the physical problems with moving and resizing partitions For example, if you have a disk, sda with 3 partitions on it:

  sda 8:0 0 160G 0 disk
            ├─sda1 8:1 0 525.5M 0 part /boot
            ├─sda2 8:2 0 1.9G 0 part /
            └─sda3 8:3 0 156G 0 part
    

And you wanted to make the root bigger (sda2). Well you can't becuase sda3 is in the way.

mbr/gpt Partitions

With LVM, the partitions are not setup like that. You have one or two “real” partitions, sda1, sda2 and the rest is logical, or virtual.

   sda 8:0 0 160G 0 disk
            ├─sda1 8:1 0 525.5M 0 part /boot
            ├─sda2 8:5 0 157.6G 0 part
            ├─vg00-root (dm-0) 254:0 0 1.9G 0 lvm /
            └─vg00-home (dm-1) 254:4 0 50G 0 lvm /home
    

This setup looks more like this:

LVM Partitions

As you can see, we have lots of free space (show in green) to make home or root bigger, or to add a new logical partition. There is nothing in the way.

So what is a Volume Group and a Physical Volume?

The Physical Volume is simply the name given to an actual physical disk that has the LVM data on. It does not manage the assignment of the space/partitions. The Volume Group is a group of physical disks that are used to provide the storage pool. You can have multiple Volume Groups and each would have a set of partitions.

So you would have three disks, sda, sdb and sdc. They are all given the LVM partition as their first partitions, sda1, sdb1 and sdc1

You can then create a Volume Group, which assigns sda1 and sdb1 for using with the server OS (Maybe a couple of 240gb SSDs) The remaining sdc disk can have a seperate Volume Group for Bulk storage of emails, or websites (Maybe a 4TB HDD) The Groups would be permanantly seperate and can never share space (in LVM terms), but equally do not rely on each other, they can function if the other fails or is lost.