Increasing root disk size in Amazon EC2 is a two stage process. You need to do both things to succeed.. #geekish

If you have a root disk on an AMI on Amazon’s EC2 server that is too small and you want to increase it, you have to do two things.

You need to 1) create a new volume and 2) you need to resize it.

To create a new volume, you have to stop the server, take a snapshot of the current drive, build a new bigger volume with the snapshot, detach the old volume and attach the new volume. (Note: make sure you get the name of the mount point correct. I was typing /dev/sda instead of /dev/sda1 and it was failing).

Once you do that and start the server, you need to login to the server and increase the disk size. For Ubuntu this will be done with resize2fs command. On Windows, it will be done with the diskpart command.

The following links will provide you with some details on these steps:

Note, for the diskpart command, you should enter a list disk and list partition command and then enter commands like this select disk=1 and select partition=1 (assuming that you want to extend disk 1 and partition 1. I think the root drive is disk 0, in which case you just enter select disk=0)

I am entering all this because I spent far too many hours figuring this out. Why should you have to as well? 🙂

2 responses to “Increasing root disk size in Amazon EC2 is a two stage process. You need to do both things to succeed.. #geekish

  1. I am not able to extend the space after adding the new (increased) volume as root device. I am able to login to the server. Opened the disk management, but there I am getting only one Disk, disk 0 and unallocated space, the space i want to add to my existing C drive. But the problem is I am not getting any “Extend” option after right clicking and also when I am trying to run this through cmd, DISKPART, select disk 0, select partition 1, then extend. It is giving error. Please help.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.