Amazon has excellent Windows support these days, and computers boot up from EBS. Drives are therefor both fast and robust. However, many time you'd like a larger C: drive than the 30 GB that come standard with the Amazon images. Here is how you enlarge the boot drive!
First step is to boot an instance. You need the command line tools for this, as neither the AWS Management Web Console nor ElasticFox currently supports this right now (note to developers - please add!).
ec2-run-instances --region eu-west-1 \
-K pk-YOURKEYHERE.pem \
-C cert-YOURCERTHERE.pem \
-b '/dev/sda1=:100' \
ami-d7a78ca3 \
-g my-security-group -g common-security-group \
-t m1.large \
-k thekeyhere \
--disable-api-termination \
--instance-initiated-shutdown-behavior stop \
-z eu-west-1a
- The command is ec2-run-instances with an 's' in the end. There is another command in the API without the s, which doesn't work.
- -b is the most important flag here. It says to make the boot disk (/dev/sda is Linux speek for C:) 100 GB, despite what the AMI manifest says (which is 30 GB).
- ami-d7a78ca3 is the Windows image, in this case a 64bit Windows 2008.
- -g security-group you should add as many as you like. Remember to think these through, since you cannot change which groups an instance belongs to.
- The flags --disable-api-termination --instance-initiated-shutdown-behavior stop are really nice, because that make sure you cannot accidentally terminate the instance, making the harddrive disappear.
- Note that I'm running in the EU region here.
Ok, so now you have a running Windows server. Once it has booted, you log on using remote desktop (well, as soon as you have the generated password, which takes 15 min). PLease note that the C: drive will show up as 30 GB at this point. The partition is still only 30 GB, even if the virtual harddrive is 100 GB.
- Go into the windows management console. Go to disk management.
- Right-click on the C: drive. Choose Extend volume from the context menu.
- In the wizard that pops up, just accept the defaults, and click finish.
Done! The change is instant (no reboot or anything), and your system drive C: is now 100 GB.
Adam Skogman
Consultant at Jayway

3 comments ↓
Thanks for sharing these instructions Adam!
Oh your the man this is great!!! one comment i had to use use double quotes on the -b switch from windows
-b /dev/sda1=:100
This post inspirares me to get the storage comes up with the plan. See my post here
http://www.serveridol.com/2010/08/30/enabling-instance-storage-on-amazon-windows-2008-ami/
Leave a Comment