Linux LVM Disk Management: Volumes, Snapshots, and Resize
LVM adds a flexible layer between disks and filesystems. You can grow volumes across disks, snapshot live data, and resize without downtime. The Logical Volume Manager, LVM, adds a flexible layer between your physical disks and the filesystems they hold. With plain partitions, resizing or spanning disks is painful. With LVM, you can grow a volume across multiple disks, take snapshots, and resize live filesystems. After managing storage on production servers for years, LVM is the default I set up whenever I have a choice. Here is how I use it. The Three Layers LVM has three layers. Physical volumes, or PVs, are the underlying disks or partitions. Volume groups, or VGs, pool one or more PVs into a single storage space. Logical volumes, or LVs, are carved out of a VG and hold filesystems. Understanding these three layers is everything else. # Make a partition or whole disk a physical volume sudo pvcreate /dev/sdb # Create a volume group named data spanning one PV sudo vgcreate data /dev/sdb # Create a 50GB logical volume named logs in data sudo lvcreate -L 50G -n logs data After creating the LV, I create…