LVM Architecture Overview
LVM provides three layers of abstraction: Physical Volumes (PV), Volume Groups (VG), and Logical Volumes (LV).
Physical Volume (PV)
Physical Volume
A Physical Volume is a disk or partition prepared for use by LVM. It represents the lowest LVM layer, created from real storage devices (e.g.,
/dev/sda, RAID LUNs).- Created with
pvcreate - Forms the building blocks of a VG
- Can be added or removed to adjust total capacity
Volume Group (VG)
Volume Group
A Volume Group aggregates one or more PVs into a single storage pool. This pool behaves like one large virtual disk.
- Created with
vgcreate - Expands by adding more PVs
- Space is allocated to LVs from the VG
Logical Volume (LV)
Logical Volume
A Logical Volume is carved out of a Volume Group and behaves like a virtual partition. Filesystems, swap, containers, or VMs are placed on LVs.
- Created with
lvcreate - Can be resized dynamically
- Supports snapshots and thin provisioning
LVM Architecture Diagram
The following diagram illustrates how physical devices flow through LVM layers:Diagram Legend
Diagram Legend
- π¨ Physical Device (PD) β Actual disk hardware
- π¦ Physical Volume (PV) β LVM-initialized disk
- π§ Volume Group (VG) β Storage pool
- π© Logical Volume (LV) β Virtual partition
Common LVM Operations
Creating a Complete LVM Setup
Resizing Logical Volumes
LVM Snapshots
Create point-in-time snapshots for backups or testing:Troubleshooting
Visualize the Storage Stack
Uselsblk to see the complete storage hierarchy:
Common Issues
Volume Group Not Found
Volume Group Not Found
Check Volume Group Free Space
Check Volume Group Free Space
Repair LVM Metadata
Repair LVM Metadata
Best Practices
Use Descriptive Names
Name VGs and LVs based on their purpose (e.g.,
data_vg, database_lv)Leave Space Free
Keep 10-20% of VG space unallocated for snapshots and growth
Monitor Usage
Regularly check
vgs and lvs output for capacity planningBackup Metadata
Periodically run
vgcfgbackup to save LVM configurationUse XFS for Large Volumes
XFS performs better than ext4 for large filesystems
Document Your Layout
Keep records of PVβVGβLV mappings and purposes
Quick Reference
| Task | Command |
|---|---|
| List PVs | pvs, pvdisplay |
| List VGs | vgs, vgdisplay |
| List LVs | lvs, lvdisplay |
| Create PV | pvcreate /dev/sdX |
| Create VG | vgcreate my_vg /dev/sdX |
| Create LV | lvcreate -L 50G -n my_lv my_vg |
| Extend VG | vgextend my_vg /dev/sdY |
| Extend LV | lvextend -L +20G /dev/my_vg/my_lv |
| Remove LV | lvremove /dev/my_vg/my_lv |
| Remove VG | vgremove my_vg |
| Remove PV | pvremove /dev/sdX |