LVM - Logical Volume Manager

LVM

LVM adds a flexible layer between physical disks and filesystems so you can resize storage live.

Physical Volume (PV)  →  Volume Group (VG)  →  Logical Volume (LV)  →  filesystem
   /dev/sdb1                  vg_data              lv_web
LayerCreateInspect
PVpvcreate /dev/sdb1pvs / pvdisplay
VGvgcreate vg_data /dev/sdb1vgs / vgdisplay
LVlvcreate -L 10G -n lv_web vg_datalvs / lvdisplay

Grow a volume (the killer feature):

$ lvextend -L +5G /dev/vg_data/lv_web
$ resize2fs /dev/vg_data/lv_web      # ext4 - grow the FS
# xfs_growfs /data                   # xfs equivalent (mounted)
Exam tip: Extending is two steps - grow the LV (lvextend) then grow the filesystem (resize2fs for ext4, xfs_growfs for xfs). xfs can only grow, never shrink.