Me Hungy

Dec 18 2010

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.

Comments
Dec 12 2010
Comments
+
Comments
Nov 13 2010
Comments
Oct 27 2010
Comments
Oct 10 2010
Comments
Sep 02 2010
Comments
Aug 26 2010

Interviewed today on TechZulu Live today by Amanda Coolong, who is super cool for making it fun and easy. Thanks Efren, for inviting me on the show, I had a blast.

Permalink: http://www.techzulu.com/ceo-to-cto-when-to-take-money-and-more-on-tzlive-with-william-chow.html

Comments
Aug 20 2010
Comments
Jul 18 2010
Comments
Page 1 of 14
Bill Israel designed