Logical Volume Management (LVM) is a flexible method of managing disk space that sits between the operating system and the physical disks. Unlike traditional partitions, LVM allows you to resize volumes, span them across multiple disks, and take snapshots without unmounting the drive.

The Three Core LVM Concepts
 
LVM is organized into three layers:
  • Physical Volumes (PV): These are your raw storage devices, such as a hard drive (/dev/sdb) or a partition (/dev/sda2). You “initialize” them so LVM can use them.
  • Volume Groups (VG): This is a virtual “pool” of storage. You combine one or more Physical Volumes into a Volume Group. It acts like a single giant hard drive.
  • Logical Volumes (LV): These are the virtual partitions you carve out of the Volume Group. You format these with a filesystem (like ext4) and mount them to folders.

 

Managing LVM: Step-by-Step
 
To set up a new disk using LVM, follow this standard sequence:
 
StepAction 
1. Create PVPrepare the disk for LVM. 
2. Create VGCreate a pool named vg_data. 
3. Create LVCarve a 20GB volume named lv_storage. 
4. FormatAdd a filesystem. 
5. MountAttach it to a folder.