Extending disk space on LVM
I was able to gain practical experience of extending disk space on a LVM volume on a Redhat system recently. One of our VMWare database servers used up all the disk space. To add more disk space, here's the process:
- Added disk resource (10GB) to the VM hard disk (Hard Disk 0) using the VSphere client.
- On the database server, used fdisk to create a new 10GB partition (/dev/sda3) on the new free space.
- Rebooted so that the OS could see the new partition
-
Added /dev/sda3 to lvm’s VolGroup00:
vgextend VolGroup00 /dev/sda3
-
Used lvextend to extend the LogVol00 size:
lvextend -l +100%FREE /dev/VolGroup00/LogVol00
-
Extended the ext3 partition sitting on top of LogVol00:
resize2fs /dev/mapper/VolGroup00-LogVol00