The beauty of LVM

I was running low on disk space on one of my servers. Luckily I had set up LVM, was using XFS and had some room to spare on my physical volume. With just 2 commands I added 1GB of space to the filesystem.

root ~> lvextend -L+1G /dev/vg00/rra
root ~> xfs_growfs /usr/local/cacti/rra

I found out how much space I had to spare using the vgdisplay command.

root ~> vgdisplay
— Volume group —
VG Name vg00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 7
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 5
Open LV 5
Max PV 0
Cur PV 1
Act PV 1
VG Size 67.10 GB
PE Size 4.00 MB
Total PE 17178
Alloc PE / Size 9728 / 38.00 GB
Free PE / Size 7450 / 29.10 GB
VG UUID vYM9vS-mmUn-2JUm-GLJB-B1gk-dJ2r-FHuCZU

Looking at “Free PE” you can see I have 29GB to use on down the road.

To learn more about lvm, check out the HOWTO

Leave a Reply