Alessandro shows you how to
dynamically expand the volume
for an EC2 Linux instance

expand-ebs-root-volume-windows-alessandro

How do I use Amazon EBS Elastic Volumes functionality to expand the EBS-based root volume of my EC2 Linux instance?

If you want to expand the EBS root volume of EC2 Linux running on a current generation instance, you can use the Amazon EBS Elastic Volumes feature. To expand the EBS-based root volume of EC2 Linux running on a previous generation instance, you must detach and reattach the volume.

1.    Review Amazon EBS Volume Performance on Linux Instances before you expand the EBS root volume of your EC2 Linux instance. This will help ensure that the modified volume provides the performance characteristics required for your scenario.

2.    Use Amazon EBS Elastic Volumes for EC2 instances and follow the steps at Modifying the Size, IOPS, or Type of an EBS Volume on Linux to expand the EBS root volume of your EC2 Linux instance.

3.    Review Considerations for Modifying EBS Volumes before you expand your Amazon EBS Elastic Volume to identify and address any potential issues before you expand your volume. For example, volumes that were attached to current generation instances before November 1, 2016 require that you either stop and restart the instance of that you detach and reattach the volume in order to initialize the Amazon EBS Elastic Volumes feature. This is a one time requirement.

Warning: When you stop an instance, the data on any instance store volumes is erased. Therefore, if you have any data on instance store volumes that you want to keep, be sure to back it up to persistent storage.

To determine when your volume was created, navigate to the volume details page in the Amazon EC2 console and view the Created field. To display the volume's most recent attachment time, which may be more recent than the creation time, use the AWS CLI.

The following command issues a query for volumes that were most recently attached before the cutoff date:

aws ec2 describe-volumes --region us-east-1 --query "Volumes[?Attachments[?AttachTime<=`2016-11-01`]].{ID:VolumeId}" --output text

The output is a text list of IDs for volumes that need attention:

vol-0EXAMPLE
vol-5EXAMPLE
vol-4EXAMPLE
vol-bEXAMPLE
vol-0db1c57561EXAMPLE
vol-06f90d0c16EXAMPLE

4.    There are other considerations listed at Considerations for Modifying EBS Volumes before you expand your Amazon EBS Elastic volume. Be sure to read this topic and address any considerations that are relevant to your environment before you expand your volume. If you are unable to use Amazon EBS Elastic Volumes, expand the EBS root volume of your EC2 Linux instances by completing the steps at Appendix: Starting and Stopping an Instance to Modify an EBS Volume.

5.    Use the methods described at Monitoring the Status of Your Volumes after you expand the EBS root volume of your EC2 Linux instance.


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2017-07-28

Updated: 2017-09-26