Increasing your AWS EC2 root partition (Windows)

As we now have instances which can be booted from EBS (hurray for that), you’re root is also increased to 30gb. But sometimes this still isn’t enough. Here is how you can increase your root partition drive using the AWS Console.

  1. login to  your AWS Console
  2. Go to [Instances], right click your instance and select [create image (EBS AMI)]
    This will make a backup (just in case)
  3. Your instance will reboot, and come up again when the image is created. After that stop your instance (do not terminate it :-) )
  4. Next is to go to [Volumes], you will see a 30Gib volume somewhere which is attached as /dev/sda1 to your instance

    Volume 

    Right click it and select [Create Snapshot from this volume].

  5. Next, go to [Snapshots]. Right click the snapshot that you created in the previous step and select [Create Volume from Snapshot], you can then specify how big this volume has to become (for example 50 Gib).

    Create Volume from Snapshot

  6. After the volume is created go back to volumes again. You will see a volume which is as large as you specified in the previous step. The status of this volume is “available”.
    Now select the volume which is currently attached to your instance. It is the one you located in step 4. Right click it and and select [Detach Volume], it will then become available.
  7. Now select your newly created volume, right click it and select [Attach Volume]. Select your instance (which will have a status of “stopped”). In the textbox “Device” type: /dev/sda1. Now click [Attach]

    Attach Volume

  8. Fire up your instance and log in.
  9. Open up computer management and select [Disk Management] (underneath the option [storage]). You will see that your root partition has some more space behind it.
  10. Right click your root partition and select [Extend Volume], walk through the wizard. Eventually your root partition will be extended.

16 thoughts on “Increasing your AWS EC2 root partition (Windows)

  1. Marc,
    Thanks a lot. For some reason it was hard to find a usefull piece about this, while a lot of Windows (Sharepoint) administrators must have been facing it.
    Grtz,
    Ben

  2. Thanks for posting this article.
    I followed the above steps but now I cannot Remote desktop to the instance and looks like the instance is not working because all the sites are down, although AWS console shows that instance is running.

    Any help is highly appreciated.

    Thanks,

  3. This happened to me twice. Up until now I have no idea why it happened.
    I just reattached my original disk, checked if the instance would start and I could RDP to it.
    I could, so I started again. It then didn’t fail.

    just a simple note: You probably did this right, but just to be sure. When you started the instance. Did ya put him in the correct Security Group (which has RDP rights from your IP).

  4. Yes, I put it under the correct security group. I am not sure what the problem was because the instance came back after an hour.

    Before that I tried following but nothing worked:
    -Attaching original volume
    -Creating a new instance from AMI (backup AMI)
    -Detaching and attaching volumes, restarting instance etc.

  5. brilliant. this is exactly what i needed. i hope they build a wizard in aws to do this process automatically…

  6. Marc
    Thanks for the article. But I have hit a stop.
    In step 7. you are saying “In the textbox “Device” type: /dev/sda1. Now click [Attach]”
    But in elasticfox, I cannot change the device type, now the volume would not attach to the stopped instance.
    Any idea, or link or something that you have, please let me know it
    I am stuck at this point now!

  7. Hi Wajih,

    As you can see through my screenshots I am using the Amazon AWS Console (also stated in step 1. (https://console.aws.amazon.com).
    You can’t do it with the help of elaticfox (not that I know off).

    You could also try the EC2 Command Line Tools, and issue the command: ec2-attach-volume -i -d /dev/sda1

  8. Thanks mate, it was the AWS console that helped me out. Though now I have the same problem Sanjeev had, no RDP and site down. Hope it is up again somehow.

  9. Belive it or not my instance IP has changed! Dont know why, but that was the reason I could not log in using RDP. Thanks to elasticfox i noticed the change. This runs me into another problem!

  10. Use an elastic IP.
    If it is attached to your server, you do not have to pay for it.
    If you do not attach it (or your system is down / off), you will pay $0,01 per hour

  11. I think the problem was at EC2 end. Only after 8 hours did the old IP comeback. Looks like Sanjeev must have gotten into the same situation, but I noticed that (I was luck to notice this, by the way) that in both AWS console and elasticfox the public IP of the machine instance for which I had expanded the drive was blank for about 5~10 minutes. After that the old IP was there again. Such a relief!!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>