Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
AWS Centos 6 AMIs do not resize the root partition #34
The AWS Centos 6 AMIs do not resize the root partition to use all of the attached EBS volume. This is a big problem because the default size is only 10GB which fills up very quickly especially when
The problem is that the AMI is relying on cloud-init's growpart module to resize the partition but apparently this only works for kernels > 3.8.
Here's the kernel in my Marketplace Chef Server I launched today.
One solution would be to rebuild the Centos 6 AMIs using the old style of resizing which is described pretty well in the Mail List thread above and also in this blog post.
After talking with @ryancragun though it seems that the better solution would be to build the AMIs using Centos 7 which is able to correctly use the cloud-init growpart module. Centos 7 build work is already underway so I think this is the direction @ryancragun plans to take to fix this issue.
In the meantime you can use
The following is an example of the partition resizing procedure.
Be sure to login as the root user when running the following commands.
If you just launched the Marketplace Chef Server then you will want to wait approximately 15 minutes for the cloud-init work to finish running. Yes, it really takes that long. :)
You can run
Once cloud-init is finished you can run
First determine the Start sector of the
In this case the Start sector is
Now use the following command to set the units to sectors, delete the partition entry from the partition table and create a new partition entry using the same Start sector value,
Now reboot the instance and when you log back in you can run
[root@ip-******** ec2-user]# df -h
The newer Marketplace Chef Server built on Centos 7 doesn't auto resize its root partition because the
As a workaround until
@Purple90 thanks, it worked:
After I typed
Then I didn't have to reboot, I just typed
Disk /dev/xvda: 530 GiB, 569083166720 bytes, 1111490560 sectors
Here's my partition table
When I try to resize partition using growpart
growpart /dev/xvda 1
NOCHANGE: partition 1 is size 16769024. it cannot be grown
ANy suggestion on how to go ahead with this?