ch11/l02

LVM layers and growth plan

Understand PV -> VG -> LV before extending storage.

lvs -a 30 min read, 35 min lab operator

LVM has physical volumes, volume groups, and logical volumes. Extending an LV is only part of growth; the filesystem may also need resizing. The safest plans prove free extents, target LV, filesystem type, and rollback or backup state.

In the field

`/var` needs more space. The host uses LVM and you need a written plan before touching it.

Worked command

$ pvs$ vgs$ lvs -a -o +devices$ lvextend -r -L +10G /dev/vg0/var
Anti-pattern

Do not run `pvcreate` or `lvextend` until target devices and backups are verified.

Safer pattern

List PVs, VGs, LVs, free space, devices, filesystem, and exact target path.

Knowledge check

You run lvextend -L +10G on an LV and it succeeds, but /var still shows no extra space. What was missed?

  • A The logical volume grew but the filesystem on it was never resized
  • B The volume group ran out of physical volumes during the extend
  • C lvextend silently rolled back because no snapshot existed
  • D df caches capacity and just needs a reboot to update
Show the answer

Correct: A. The logical volume grew but the filesystem on it was never resized

Why

Extending the LV only enlarges the block container; the filesystem must also grow, which is exactly what the -r flag in lvextend -r does in one step. Assuming the space appears automatically is the classic LVM growth mistake.

Practice checklist

  1. Use a disposable VM or sample LVM output.
  2. Draw PV -> VG -> LV.
  3. Write a growth plan without executing it.

Deliverable evidence

  • A layer map and a no-execute growth plan.
Teaching diagramch11 · mental model
device -> filesystem -> mount, layered through LVM /dev/sda block device (lsblk) PV -> VG -> LV pvs / vgs / lvs ext4 / xfs filesystem (blkid) /var (mount) findmnt / df -h grow: lvextend -r -r resizes the filesystem too lvcreate -s snapshot of origin LV snapshot fills -> rollback lost (not a backup) verify from many signals before any destructive command

shows: How a mount point sits on a filesystem, on an LV stacked through VG and PV onto a block device, plus where growth and snapshots act.

does not prove: It is a schematic of the relationships, not evidence of your host's actual layout — only lsblk, findmnt, blkid, and lvs output prove that.

Memorize this

Commit these to memory, then drill them until recall is automatic.

pvsvgslvslvextend -rfree extents
Recall practice · Meaning -> flags

cue In lvextend -r, what does -r do?

show recall target

Resizes the underlying filesystem (resize2fs for ext4, xfs_growfs for xfs) to match the new LV size