Issues trying to increase EBS root disk size
I was running out of space on my EC2-hosted system and Eric Hammond’s instructions for increasing the size of the root disk offered a fantastically simple solution: just run 2 commands from the EC2 tools and I’ll be all set. Except it didn’t work for me. A little googling made it clear that this worked for others, but it was a total mystery what was different in my case. After futzing with it with it for a couple of days, I eventually found a sequence that did work for me, and the key was to manually register a new AMI (using a snapshot of the under-sized source volume).
Prior to that, I had tried using the existing AMI, as well as creating a new AMI from the web GUI (via “create image (EBS AMI)” on the instance’s right-click menu), but the instance would never boot (e.g. detailed monitoring showed no cpu activity) and the volume seemed to be stuck in “attaching” (instead of the typical “attached” state).
So, here is what I did, in just 2 commands:
First, create a snapshot and then register it to create a new AMI:
ec2-register -s snap-1234 -a x86_64 -d “xxx” -n “yyy” —kernel aki-1234 —ramdisk ari-1234
IMAGE ami-1234
Now, you can spin up your instance with a larger size (was 15GB, now 50GB):
ec2-run-instances ami-1234 -t m1.large -k mykeypair -g mysecgroup -b “/dev/sda1=snap-1234:50:false”
RESERVATION r-1234 599377512345 mysecgroup INSTANCE i-1234 ami-1234 pending mykeypair 0 m1.large 2010-12-19T05:05:11+0000 us-east-1a aki-1234 ari-1234 monitoring-disabled ebs paravirtual xen
Yay, my instance boots and shows the new space:
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 13G 35G 26% /
Then finally, don’t forget to run resize2fs within your new instance to use the new space.

