| Did this page help you? Yes No Tell us about it... |
Topics
Amazon Elastic Block Store (Amazon EBS) provides block level storage volumes for use with Amazon EC2 instances. Amazon EBS volumes are highly available and reliable storage volumes that can be attached to any running instance. The attached Amazon EBS volumes are exposed as storage volumes that persist independently from the life of the instance.
You can attach multiple volumes to the same instance within the limits specified by your AWS account. As per your AWS account, you can have up to 5000 EBS volumes or 20Tib in total volume storage, whichever you reach first. Each EBS volume can be from 1GiB to 1 TiB. If you find the default volume limits not meeting your specific requirements, go to the Amazon EBS Volume Limit Request Form to request for more.
Data Availability
When you create an Amazon EBS volume in an Availability Zone, it is automatically replicated within that zone to prevent data loss due to failure of any single hardware component. After you create a volume, you can attach it to any Amazon EC2 instance in the same Availability Zone. Once attached, the volume appears as a native block device similar to a hard drive or other physical device. At that point, the instance can interact with the volume just as it would with a local drive; the instance can format the EBS volume with a file system such as ext3 (Linux) or NTFS (Windows) and install applications. You use the file system to access the stored files.
An EBS volume can be attached to only one instance at a time within the same Availability Zone. However, multiple volumes can be attached to a single instance. If you attach multiple volumes to a device that you have named, you can stripe data across the volumes for increased I/O and throughput performance.
You can get monitoring data for your Amazon EBS volumes at no additional charge (this includes data for the root device volumes for Amazon EBS-backed instances). For more information, see Monitoring Amazon EBS Volumes.
Data Persistence
An Amazon EBS volume is off-instance storage that can persist independently from the life of an instance (An exception to this rule is an EBS volume created and attached to an instance at launch. See the following paragraph for more information). On instance termination, the attached EBS volume automatically detaches from the instance with the data intact. The volume can then be reattached to a new instance, allowing for quick recovery. If you are using an EBS-backed instance, you can stop and restart that instance without affecting the data stored in the attached volume. The volume remains attached throughout the stop-start cycle. This allows you to process and store the data set indefinitely, only using the processing and storage resources when required. The data set persists in the volume until the volume is deleted. After a volume is deleted it cannot be attached to any instance.
![]() | Note |
|---|---|
You continue to pay for the volume usage as long as the data persists. |
EBS volumes that are created and attached to an instance at launch
are, by default, deleted when that instance is terminated. This behavior can be modified by
changing the value of the flag DeleteOnTermination to false while
launching the instance. The modified value causes the volume to persist after the instance is
terminated. This volume becomes available to be attached to another instance. EBS volumes
attached to an instance after it is already running are, by default, not deleted on instance
termination.
![]() | Note |
|---|---|
If the EBS volume is created when the instance is created, then the termination of the instance deletes the volumes by default. If the volume is created explicitly, then it must be deleted explicitly. |
Snapshots
Amazon EBS provides the ability to create snapshots (backups) of any Amazon EC2 volumes. A snapshot of an EBS volume causes a copy of the data in the volume to be written to Amazon S3, where it is stored redundantly in multiple Availability Zones. After writing data to a volume, you can periodically create a snapshot of the volume to use as a baseline for new volumes. The volume need not be attached to a running instance in order to take a snapshot. The snapshots can be used to create multiple new Amazon EBS volumes, expand the size of a volume, or move volumes across Availability Zones. When a new volume is created using a snapshot, it is an exact replica of the original volume. By optionally specifying a different volume size or a different Availability Zone, you can use this functionality to increase the size of an existing volume or to create duplicate volumes in new Availability Zones. The snapshots can also be shared with specific AWS accounts or made public.
Amazon EBS snapshots are incremental backups, meaning that only the blocks on the device that have changed since your last snapshot will be saved. If you have a device with 100GiB of data, but only 5GiB of data have changed since your last snapshot, only the 5GiB of modified data will be stored back to Amazon S3. Even though snapshots are saved incrementally, the snapshot deletion process is designed so that you need to retain only the most recent snapshot in order to restore the volume.
To help categorize and manage your volumes and snapshots, you can tag them with metadata of your choice. For more information, see Using Tags.
Amazon EBS is used when data changes frequently and requires long-term persistence. Amazon EBS is particularly well-suited for use as the primary storage for a file system, database, or for any applications that require fine granular updates and access to raw, unformatted block-level storage. Amazon EBS is particularly helpful for database-style applications that frequently encounter many random reads and writes across the dataset.
The combination of Amazon EC2 and Amazon EBS makes it easy to design and develop steps to optimize the performance and resource utilization of your servers and storage devices.
The following task lists describe some of the common tasks performed when using Amazon EBS.
Expanding the Storage Space of a Volume
|
1 |
Create a snapshot of the volume attached to your running instance. When a snapshot is created, any AWS Marketplace product codes from the volume will be propagated to the snapshot. | |||
|
2 |
Create a new volume from the snapshot by specifying a larger size than the original volume. Any AWS Marketplace product codes from the snapshot are propagated to the volume. | |||
|
3 |
Attach the new volume to your instance.
For an overview of the AWS Marketplace, go to https://aws.amazon.com/marketplace/help/200900000. For details on how to use the AWS Marketplace, see AWS Marketplace. | |||
|
4 |
Detach and delete the old volume. If the root volume is detached from an instance with an AWS Marketplace product code, then the AWS Marketplace product codes from that volume will no longer be associated with the instance. |
Adding Multiple Copies of Your Volume to Your EC2 Instances
|
1 |
Create a snapshot of the volume attached to your running instance. When a snapshot is created, any AWS Marketplace product codes from the volume will be propagated to the snapshot. | |||
|
2 |
Create the new volumes you need using the snapshot. Any AWS Marketplace product codes from the snapshot are propagated to the volume. | |||
|
3 |
Attach the newly created volumes to your EC2 instances.
For an overview of the AWS Marketplace, go to https://aws.amazon.com/marketplace/help/200900000. For details on how to use the AWS Marketplace, see AWS Marketplace. |
Reducing Use of Storage Resources When Traffic Decreases
|
1 |
Identify the volume or volumes that are not currently needed. | |||
|
2 |
[optional] Create snapshots of the identified volumes. When a snapshot is created, any AWS Marketplace product codes from the volume will be propagated to the snapshot. | |||
|
3 |
Detach the volume(s) from the instance.
| |||
|
4 |
To remove the data from the volume, delete the volume.
|
Data Persistence after Instance Termination
By default, any volumes that were created when the instance launched
are automatically deleted when the instance terminates (in other words, their
DeleteOnTermination flags are set to true by default). However, any
volumes that you attached after the instance was running are not
automatically deleted (their DeleteOnTermination flags are set to
false by default). You can change the default behavior by setting the
DeleteOnTermination flag to false when you launch the instance. For
an example of how to change the flag at instance launch, see Using Amazon EC2 Root Device Storage.
The following diagram and task list describe the different states of a volume from the time it is attached to an instance until the time the instance terminates.

Persisting Data after Instance Termination
|
1 |
Launch an instance from an EBS-backed AMI and set the value of
| |||
|
2 |
Create snapshots of the volume at regular intervals. When a snapshot is created, any AWS Marketplace product codes from the volume will be propagated to the snapshot. | |||
|
3 |
Make changes to the data in the volume by doing some processing.
| |||
|
4 |
Terminate the instance. The volume gets detached from the instance. |
The volume, after instance termination, persists in its modified state. This is a new and a different volume from its initial state and is no longer associated with its original AMI.
When you launch an instance of a particular AMI and then terminate the instance, the detached volume will retain its original volume ID. If you launch another instance of the same AMI, the volume associated with the newly launched instance will have a different volume ID.
Using the Modified Volume (Volume B) after Instance Termination
|
1 |
Create a new EBS-backed AMI from the snapshot of the detached volume. When a snapshot is created, any AWS Marketplace product codes from the volume will be propagated to the snapshot. | |||
|
2 |
Launch an instance using the newly created AMI.
|
Using the Initial Volume (Volume A) after Instance Terminates
|
Launch an instance from EBS-backed AMI and set the value of
|
Data Availability
A single Amazon EBS volume is constrained to the single Availability Zone where it is created and becomes unavailable if the Availability Zone itself is unavailable. However, a snapshot of an Amazon EBS volume is available across all of the Availability Zones within a Region. You can use these snapshots to create volumes and make them available in more than one Availability Zone.
Making Your Data Available in Multiple Availability Zones
|
1 |
Create a snapshot of the volume that you want to make available in another Availability Zone. When a snapshot is created, any AWS Marketplace product codes from the volume will be propagated to the snapshot. |
|
2 |
Create a new volume using the snapshot created in the previous step, and specify a different Availability Zone. Any AWS Marketplace product codes from the snapshot are propagated to the volume. |
|
3 |
Launch a new instance in that Availability Zone and attach the new volume. |