Interview Prep/Linux/Storage & Memory

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
All Linux questions Roadmap: Linux

More on Storage & Memory