


LVM architecture (three layers)
Think of LVM in three simple layers:- Physical Volumes (PV): the real disks or partitions you initialize for LVM.
- Volume Group (VG): a combined storage pool built from one or more PVs.
- Logical Volumes (LV): the usable block devices you create from the VG; they can be formatted, mounted, and resized.

Common LVM commands
Below is a compact reference of the primary LVM commands organized by layer. Use these commands to initialize devices, build pools, and manage logical volumes.
You can think of the command flow as PV → VG → LV; the naming conventions make the workflow intuitive.
Example listing of the commands:
Benefits of LVM
- Flexible allocations: grow or shrink volumes (within filesystem limits) as needs change.
- Storage pooling: combine multiple disks into a single administration unit to simplify capacity management.
- Online resizing: extend logical volumes (and typically their filesystems) without rebooting.
- Snapshots: capture point-in-time volume states for backups, testing, or safe upgrades.

Online resizing often works without downtime, but it depends on the filesystem. For example, XFS supports online growth with xfs_growfs but cannot be shrunk;
ext4 can typically be grown online with resize2fs and usually requires unmounting to shrink. Always check filesystem capabilities before resizing. Also consider using thin provisioning or modern snapshot approaches for better snapshot performance.Quick workflow example (high level)
- Prepare devices as PVs:
pvcreate /dev/sdb /dev/sdc - Create a VG from those PVs:
vgcreate vg_data /dev/sdb /dev/sdc - Create an LV from the VG:
lvcreate -n lv_backup -L 100G vg_data - Format and mount the LV:
mkfs.ext4 /dev/vg_data/lv_backup→mount /dev/vg_data/lv_backup /mnt/backup - Increase an LV when needed:
lvextend -L +50G /dev/vg_data/lv_backupthen grow the filesystem (e.g.,resize2fsorxfs_growfsas appropriate)
Links and references
- LVM man pages and documentation: https://man7.org/linux/man-pages/man8/lvm.8.html
- XFS filesystem: https://en.wikipedia.org/wiki/XFS_filesystem
- ext4 filesystem: https://en.wikipedia.org/wiki/Ext4
- Thin provisioning overview: https://en.wikipedia.org/wiki/Thin_provisioning
- Kubernetes and LVM (storage planning): https://kubernetes.io/docs/concepts/storage/volume-pvc-datasource/