How to expand the size of an EBS volume in AWS

CLOUDDRIVE-300x2811 (1)

The great thing about hosting your servers in the cloud with a provider such as Amazon Web Services is that you can provision your servers for the amount of resources you need today without having to over provision for your needs tomorrow which saves you money.  When the time comes to allocate additional storage to your AWS server, you can follow these simple steps to expand your elastic block storage (EBS) volume.  In this quick guide, we will show you how to expand the size of your EBS volume on a Linux EC2 instance, and extend the file system if needed.

1.) Login to your AWS console, and click EC2 → Instances

2.) Locate the instance you want to expand, and confirm it’s shutdown behavior is set to STOP.
Screen Shot 2015-02-16 at 9.01.05 AM

   Under “Elastic Block Store” click on “Volumes”

Screen Shot 2015-02-16 at 9.03.34 AM

4.)  Make note of the device name in the “attachment information” column for the particular volume you want to expand, since the new volume with have to be attached using the same name.  Also make note of the availability zone this volume resides in. In this example, the device name is /dev/xvda and it resides in US-WEST-2A

Screen Shot 2015-02-16 at 9.05.46 AM

5.)  Right click on the volume, and select “Create Snapshot”  This process may take a few minutes.

Screen Shot 2015-02-16 at 9.06.43 AM

6.)  Give your snapshot a name and description.

Screen Shot 2015-02-16 at 9.07.32 AM

7.)  Click on “Snapshots” under the “Elastic Block Store” navigation.  Here you will see the snapshot you just created.

8.)  Right click on the snapshot and select “Create Volume”

Screen Shot 2015-02-16 at 9.09.09 AM

9.)  Enter a new size for the volume in GB that you would like to expand to.  In this example, we want our disk to be 13GB total.  It’s also important to make sure your disk is in the same availability zone as the original.

Screen Shot 2015-02-16 at 9.09.48 AM

10.) Navigate back to “Volumes” under “elastic block store” and you should see your newly created volume listed.  Right click the old volume, and select “DETACH VOLUME”

Screen Shot 2015-02-16 at 9.13.17 AM

11.)  Right click on the new volume, and select “attach volume”

Screen Shot 2015-02-16 at 9.14.08 AM

12.)  Search for your instance that you want to attach the volume to, and enter the device name that you recorded in step 4.
Screen Shot 2015-02-16 at 9.14.58 AM

13.)  Power on your EC2 instance and confirm the larger disk is available by typing “df -h”.  Once you confirm your volume has been expanded, it’s best practice to go into “volumes” under “elastic block store” and delete the old volume you took the snapshot from.

Screen Shot 2015-02-16 at 9.17.14 AM

If your file system was not automatically expanded, you may have to run “resize2fs /dev/xvda1” .  In Windows, the process is similar however in step 13, you would simply open disk management and extend the volume to the unallocated space.

About the Author

Nick Underwood

Nick Underwood has over 15 years of experience supporting IT infrastructures for businesses across a broad range of industries.


    Get Your Project Started With a Free Consultation

    Get a Free Consultation