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
#or
xfs_growfs /MOUNT_POINT

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.

4 Comments

  1. Omar Naas says:

    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

  2. Aaron says:

    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.

  3. Aaron says:

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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trending Posts