Skip to main content
Version: 2.1

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 updates#

sudo yum update -y

Install the EPEL helper package#

sudo yum install -y epel-release

Install cloud-init and dracut-modules-growroot#

This 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 root#

sudo 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 VM#

reboot

Check the partition#

$ lsblkNAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda      8:0    0  20G  0 disk`-sda1   8:1    0  20G  0 part /
Last updated on by Roy Tan