Reaching out to others! Free & Open Source Software, Kannada, L10n, L18n Data Science, Cloud Computing & more…

Expanding LVM on a live server is a big challenge. At least for me it was big enough. That too when you’re doing it for the first time you will be bit more scared. DELL PowerEdge comes with RAID-5. We recently added a 5th drive into this array and configured that as the VirtualDisk via DELL Server management tool called OpenManage.

The next step involves expanding the size of the partition without formatting the content. Following link helped us a lot with this LVM Expansion but before that, we had to run fdisk on the drive and delete the partition first (without writing it),  then recreate and set the partition id to Linux LVM. Finally write all these changes to disk and reboot the server. Once this is done, expanding LVM is easy. Deleting partition in fdisk is very scary. You have to be very sure about such commands on Linux box.  Thanks to Dave from Atjeu for testing all this on a test server before implementing.

Ubuntu Forum thread which gave me the required hint.
(We used the instructions from step13 onwards)

Here is what we had to do with the LVM expansion.

umount /var/backup

fdisk /dev/sda (Delete the partition which needs to be expanded, without saving recreate the same partition to add additional space and then save the partition. Read the reference links provided for more inputs.)

pvdisplay

pvresize /dev/sda

pvdisplay

lvextend -v -l +4372 /dev/VolGroup00/LogVol04

vgdisplay -A

resize2fs -p /dev/VolGroup00/LogVol04

e2fsck -f -v /dev/VolGroup00/LogVol04

resize2fs -p /dev/VolGroup00/LogVol04

e2fsck -f -v /dev/VolGroup00/LogVol04

e2fsck -D /dev/VolGroup00/LogVol04

df -h

mount /var/backup

Here /dev/sda is the disk, /dev/sda2 is the partition, /dev/VolGroup00/LogVol04 is the volume which we wanted to expand. /var/backup is the mount point.

References :
A CentOS link which was referenced with the other link given above was also found to be very useful. You can read it here.

CentOS How-To on LVM

How to from TLDP.org

Dell documentation on LVM

IBM Pages on Linux LVM

Fedora wiki page on LVM

Yet another blog post which found to be useful

Related Articles

Related