CentOS 6 - Troubleshoot root disk not resized
#
Problem:Centos 6 Generic Cloud Image doesn't resize root partition accordingly#
$ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 20G 0 disk`-sda1 8:1 0 8G 0 part /
#
Solution:#
Install all available updatessudo yum update -y
#
Install the EPEL helper packagesudo yum install -y epel-release
#
Install cloud-init and dracut-modules-growrootThis has to be done after installing epel-release, because otherwise YUM won't look in the EPEL repository, where dracut-modules-growroot is available.
sudo yum install -y cloud-init dracut-modules-growroot
#
Switch to rootsudo su
#
Rebuild all initramfs images.This is very important. Without rebuilding the initramfs images, the module won't be available and nothing will get done.
rpm -qa kernel | sed 's/^kernel-//' | xargs -I {} dracut -f /boot/initramfs-{}.img {}
#
Reboot the VMreboot
#
Check the partition$ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 20G 0 disk`-sda1 8:1 0 20G 0 part /