https://drive.google.com/file/d/1WA7Z5d-jAj-XILihYJ87rn2dW28SoX2I/view?usp=sharing
| Component | Purpose | Example |
|---|---|---|
| Physical Volume (PV) | Raw storage (disk/partition) | /dev/sda1, /dev/sdb |
| Volume Group (VG) | Pool of PVs | LinuxVG |
| Logical Volume (LV) | Usable "partition" from VG | /dev/LinuxVG/LinuxLV |
✅ Benefits: Resize volumes online, combine disks, snapshot support.
# Partition /dev/sda
sudo fdisk /dev/sda
# In fdisk:
# n → p → 1 → [Enter] → +2G → t → 8e (Linux LVM)
# n → p → 2 → [Enter] → +3G → t → 8e
# w
sudo partprobe # Reload partition table
lsblk # Verify sda1, sda2
💡 Partition Type 8e: Marks partition as LVM (required for safety).
sudo pvcreate /dev/sda1 /dev/sda2 # Initialize both partitions
sudo pvs # Brief PV info
sudo pvdisplay # Detailed PV info
⚠️ Warning: pvcreate erases data on the partition!
sudo vgcreate LinuxVG /dev/sda1 # Start with sda1
sudo vgs # Brief VG info
sudo vgdisplay # Detailed VG info