LVM is a storage virtualization technique that implements an additional abstraction layer.
At the bottom layer, an LVM system need one or more physical volumes (PVs). An individual physical volume can be a hard disk partition, a RAID device or any mass storage device. If a partition is used, the partition type is 0x8e (hexadecimal 8e).
Each PV is divided into individual chunks called physical extents (PEs). A PE is the smallest unit of manipulation by other layers of LVM.
A volume group (VG) is a collection of PEs. Note that multiple VGs can share the same PV. This is because the allocation is based on PEs, not entire PVs.
A VG consists of any number of logical volumes (LVs). A logical volume can be seen as a block device. As a result, a file system can be formatted on an LV. When an LV is constructed, PEs are allocated from the parent VG to form logical extents (LEs) for the LV. Normally, an LE of a LV maps to a PE of the parent VG. However, an LV can also be set up to use mirroring. If an LV is mirrored, each LE maps to multiple PVs for the purpose of redundancy.
What is the advantage of all this complexity? The use of LVM makes LVs very flexible. Assuming there are enough PEs allocated to a VG, an LV can expand on-the-fly without incuring any down time. This is equivalent to moving and resizing partitions on a regular desktop computer! Furthermore, the expansion of an LV is immediate because there is no moving of data.
If a live-resize capable file system (such as XFS and ext3) is used on an LV, then the file system itself can also be extended on the fly without any down time. This means that if the volume for end user data is about to run out of space, a system administrator can expand the volume on-the-fly!
At the same time, if an LV is no longer useful, it can easily be deleted. The PEs previously allocated to the deleted LV will be available to the other LVs.
LVM can also support some other interesting operations. For example, an LV can be set to a “snapshot” mode. This ability allows the snapshot of an LV to appear static while the actual LV is being used. This technique allows back up tools to back up the snapshot of an LV without worrying that files are still being modified during the back up process.