LVM Resize root partition -Centos



This is more of Resize LVM
I have tested this on CentOS 5.5. Since this is root partition modification, I’ll recommend to keep config backup before proceeding.

create new partition (partition id should be 8e Linux LVM)
ADD PHYSICAL VOLUME

pvcreate /dev/new_partition

Verify new physical volume

pvdisplay
Or
pvscan

Extend existing VOLUME GROUP

vgextend VolGroup00 /dev/xvda3


make sure vg free size is = new partition size using vgdisplay command
Extend existing LVM by adding new partition

lvextend /dev/VolGroup00/LogVol00 /dev/xvda3

make sure lv size is increased, use lvdisplay

RESIZE FILE SYSTEM
Reboot Linux to init1

umount /dev/VolGroup00/LogVol00
fsck -f /dev/VolGroup00/LogVol00

Mount / partition or reboot to init1 for following command to run.

resize2fs /dev/VolGroup00/LogVol00

Now you may reboot & check / partition size.


if you find any missing point in here, please let us know in comment section or tweet us at @linuxreaders. To get more articles like this, subscribe to our RSS feeds / Mails.
Read 248 articles by
  • http://www.facebook.com/omar.naas Omar Naas

    Awesome! You need to mount the / into rw mode so you can do it with this: #mount -o remount -rw /dev/mapper/VolGroup00-LogVol00 / keep up n_n

  • http://www.cuskit.co.uk Aaron

    Thanks for replying Dhaval. What you suggested sounds the likely cause and a good solution. In the end I used the CentOS Live CD which worked a treat.

  • http://www.cuskit.co.uk Aaron

    Even once I’m in single user I still cannot unmount /dev/VolGroup00/LogVol00. It comes back with umount: /: device is busy. Any ideas?

    • http://www.linuxreaders.com/ Dhaval Thakar

      I guess you are going to init1 from init3/init5 try to get init1 while booting, using grub.

Trending Posts