LVM — the Logical Volume Manager — puts a layer of indirection between your disks and your filesystems. Instead of "this partition is this disk", you get pooled storage you can resize while it is in use. It is the reason server admins shrug at "we need more space on /var".

The three-layer model #

The stack: disks become volumes
$ sudo pvcreate /dev/sdb /dev/sdc          # physical volumes
$ sudo vgcreate tank /dev/sdb /dev/sdc     # volume group: the pool
$ sudo lvcreate -n projects -L 500G tank   # logical volume: a slice
$ sudo mkfs.ext4 /dev/tank/projects
$ sudo mount /dev/tank/projects /projects

Physical volumes are the raw disks or partitions. The volume group pools them — two 1 TB disks become 2 TB of tank. Logical volumes are carved out of the pool and hold filesystems, and they can span physical disks, which partitions cannot.

The resize superpower #

Grow a volume and its filesystem live, in three measured steps:

Extend projects by 200G, online
$ sudo lvextend -L +200G /dev/tank/projects
$ sudo resize2fs /dev/tank/projects     # ext4 grows while mounted

Modern systems fold that into one command (lvextend -r), which also shrinks carefully — shrink the filesystem first, then the volume, never the reverse.

Surveying what you have #

CommandShows
pvs / vgs / lvsOne-line summaries of each layer
pvdisplayFull physical volume detail
vgdisplayPool size and free space
lvs -aVolumes, including snapshots

Snapshots are LVM's quiet gift — a frozen view of a volume that costs only the changed blocks:

Snapshot before a risky change
$ sudo lvcreate -s -n projects-snap -L 20G /dev/tank/projects
$ # ...experiment...
$ sudo lvremove /dev/tank/projects-snap

The volume a filesystem lives on still needs choosing — see ext4 vs btrfs — and mounting belongs to mount and fstab. More in the terminal notes.