What is LVM? Explain PV, VG and LV.
BeginnerConceptStorage & Memory
Answer
LVM adds a flexible layer between disks and filesystems.
- PV (physical volume): a disk or partition initialized for LVM.
- VG (volume group): a pool made from one or more PVs.
- LV (logical volume): a "virtual partition" carved from a VG, formatted with a filesystem.
sudo pvcreate /dev/sdb /dev/sdc
sudo vgcreate vgdata /dev/sdb /dev/sdc
sudo lvcreate -n lvapp -L 200G vgdata
sudo mkfs.xfs /dev/vgdata/lvapp
pvs; vgs; lvs
More on Storage & Memory
How do you list disks, partitions and filesystems?IntermediateMBR vs GPT partition tables?IntermediateWalk through adding a new disk and mounting it permanently.IntermediateExplain the six fields of an /etc/fstab line.IntermediateWhy use UUIDs and `nofail` in fstab?IntermediateWhat does a bad fstab entry do, and how do you recover?Advanced