Select Category
Sitemap Help Contact
print article

Explanation of Logical Volume Management (LVM)

The minimal install of CentOS now utilizes LVM (Logical Volume Management). Logical Volume Management allows greater flexibility with disk management. Say for instance, a server has 2 hard drives with only the first disk being used and the second disk has never been used. The first disk contains all data the server needs to run and contains the files to host a website. In this scenario, the /usr partition has become completely full on the first disk. There is available space remaining in the other partitions on the first hard drive, but to increase the /usr partition, one would need to shrink another partition on the first disk. One could shrink the /var partition 3GB so that the /usr partition can be increased 3GB. This involves multiple steps and has some risk of data loss involved in the process.

Another option is to simply use some or all the space on the second drive that has not been used. This would require one to partition and format the second disk and mount that partition to a folder on the server. It may then be possible to migrate some data from the /usr partition to the second drive (if it won't endanger server functionality). This would free up space in the /usr partition but again, carries some risk and is not ideal.

You may be thinking "Why can't I use the available space on the second disk to increase my /usr parition?" to which the answer is "Because it's just not possible!" however with LVM, it is!

Using LVM, one could use a logical volume for /usr rather than a standard partition. A logical volume can be increased and decreased (depending on the file system) quite easily and logical volumes can span multiple disks. The CentOS minimal image provided by 1&1 has already been set up using LVM.

Logical Volumes have been created for /usr, /var, etc. at a minimal size (typically under 5GB each) for the CentOS image provided. The logical volumes use the xfs file system which means that shrinking a logical volume is not currently supported however with each logical volume being such a small size to begin with, one can increase a logical volume in just a few steps whenever additional space is necessary. As stated earlier, if more than one hard drive is installed in the server, a logical volume can be increased using available space on the second drive.

For more information about increasing a logical volume, please reference How can I increase a logical volume?
For more information regarding LVM, reference LVM HOWTO