Logical Volume Management
Objective
Hands-on practice with logical volume management in a Linux environment.
Tools & Technologies
pvcreatevgcreatelvcreatelvextendresize2fs
Key Commands
pvcreate /dev/sdbvgcreate vg0 /dev/sdblvcreate -L 10G -n lv_data vg0lvextend -L +5G /dev/vg0/lv_data && resize2fs /dev/vg0/lv_dataLab Steps
01
Physical Volumes
Initialize block devices as LVM physical volumes with pvcreate.
02
Volume Groups
Combine physical volumes into a volume group for pooled storage.
03
Logical Volumes
Create logical volumes from the VG pool with arbitrary sizes and names.
04
Online Resize
Extend a mounted filesystem online using lvextend and resize2fs.
Challenges Encountered
- XFS volumes require xfs_growfs instead of resize2fs
- Reducing LVM volumes risks data loss — always backup first
Key Takeaways
- LVM adds a layer of abstraction enabling online resize and snapshots
- pvdisplay, vgdisplay, lvdisplay show full metadata