Logical Volume Management: How PVs form VGs for LVs

Posted by zjem on Tue 22 Apr 2008 at 16:19

When I set out to build my first system using Logical Volume Management I was surprised by the lack of information about how LVM relates to more "traditional" disk-level partitioning. There were plenty of articles with examples of how to use 'vgcreate' and 'lvresize' and no short supply of advice and white noise from the forums, but there was very little practical information about what the various strata of LVM were actually for or how they related to each other. In fact I was well into my search for information before I figured out where to put the file system.

I decided to write this article not as a how-to but as an introduction for anyone who is familiar with the how and why of traditional disk partitioning schemes but is new to Logical Volume Management.

What is Logical Volume Management..?

LVM is simply an additional abstraction layer between the physical storage medium and your data that makes system design and administrative changes easier once the file system is in use.

Wow, that was incredibly concise and well worded, you must be very well paid! Now, what is Logical Volume Management..?

The foundation of Logical Volume Management is the "Physical Volume". Physical Volumes match up 1-to-1 with existing disk-level partitions. Just like "traditional" partitions a physical disk can have multiple Physical Volumes but Physical Volumes can not exceed the maximum size of the disk they occupy. Unlike a traditional partition a Physical Volume is not formatted with a file system, it is just there to support a Volume Group.

Volume Groups are composed of one or more Physical Volumes. Even if you have only one disk and create only one disk-level partition resulting in a single Physical Volume you still must create a Volume Group composed of that single volume. Physical Volumes can be added to and removed from Volume Groups but Volume Groups can not be resized arbitrarily, they are the sum of their underlying Physical Volumes. It is with Volume Groups that you get your first real layer of abstraction from the physical disk, you can have multiple Volume Groups on a single physical disk or multiple physical disks in a single Volume Group.

Logical Volumes are the functional equivalent of disk-level partitions, they are where the file system and your data reside. Logical Volumes are created within Volume Groups similar to the way that traditional partitions are created on physical disks. There is nothing to say that a Logical Volume can't consume an entire Volume Group, and Logical Volumes from multiple Volume Groups can be joined in a single directory structure but a single Logical Volume can not span multiple Volume Groups.

In summary, an LVM partitioning scheme is created by...

A note on RAID...

RAID operates on disk-level partitions and presents the resulting usable space as a single "device". The "RAID device" resides below LVM and can be assigned a Physical Volume just like a disk-level partition.

I hope this has reduced and not increased the mystery surrounding this very useful administrative tool. -Joe


This article can be found online at the Debian Administration website at the following bookmarkable URL (along with associated comments):

This article is copyright 2008 zjem - please ask for permission to republish or translate.