LVM: creating PVs, VGs and LVs
Sign in to read this lesson
A partition's size is set once — growing it when it fills up is hard. LVM puts a flexible layer between disks and file systems — you can combine several disks into one pool, grow volumes while they run, and take snapshots. RHEL itself is installed on LVM. In this lesson we build LVM from scratch.
What you will learn
- Three layers: PV (physical volume — a disk or partition) → VG (volume group — a pool) → LV (logical volume — a "virtual partition").
pvcreate /dev/sdb,vgcreate vgweb /dev/sdb,lvcreate -n lvdata -L 2G vgweb— the sequence.- Checking:
pvs,vgs,lvs(short),pvdisplay,vgdisplay,lvdisplay(detailed). - The LV path:
/dev/vgweb/lvdata=/dev/mapper/vgweb-lvdata; use either in fstab. - Size:
-L 2Gan exact size,-l 100%FREEall remaining space,-l 50a number of extents.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.