All the preparations to grow the ext4 root LVM partition on CentOS 6.6 64-bit running on XenServer 6.2 have been completed.
xvda
virtual disk on XenServer - check.xvdaN
as LVM on CentOS guest using fdisk - check.pvcreate /dev/xvdaN
on CentOS guest - check.vgextend VolGroup /dev/xvdaN
on CentOS guest - check.lvresize --extents /dev/mapper/VolGroup-lv_root
on CentOS guest - check.Now I need to resize2fs /dev/mapper/VolGroup-lv_root
. Here's the problem.
It's the root volume. My understanding is that it cannot be resized while the VM is running - lest we corrupt the volume. However, the volume is not recognized when I boot from the CentOS 6.5 LiveCD iso (there is no 6.6 LiveCD.)
So, how do I resize2fs a logical volume that cannot be touched with the VM running, and isn't recognized when the VM is not running?
Eventually found the answer online...
sudo su -l
Switch user to rootvgchange -aay
This is the magic. It will automatically find and activate existing volume groups.e2fsck -f /dev/mapper/VolGroup-lv_root
Force check the volume for errorsresize2fs /dev/mapper/VolGroup-lv_root
Add available space to volumee2fsck -f /dev/mapper/VolGroup-lv_root
Force check the volume for errorsreboot
...and viola, the root volume is now using the additional available space.