Create an inventory of your EBS volumes
Amazon EBS provides scalable, high-performance block storage resources that can be used with EC2 instances. You can attach an EBS volume to an EC2 instance. You can also detach an EBS volume from an EC2 instance.
The following are the key characteristics of EBS storage. A system administrator can get information about these characteristics for your EBS resources and use it to configure functionally equivalent storage for servers that you run on premises or servers from another Cloud Provider. A system administrator can also retrieve the data stored in your EBS resources and then store the data on premises or in storage from another Cloud Provider.
| Characteristic | Description |
|---|---|
| Volumes | An EBS volume is a durable, block-level storage device that you can attach to an instance, format, and mount. |
| I/O performance | Amazon EBS provides multiple volume types, which differ in terms of performance characteristics and price. |
| Contents of your EBS data volumes | The only way to directly access the data on a volume is from the instance. |
| Snapshots | An EBS snapshot is a point-in-time copy of the data on an EBS volume. Snapshots are stored in Amazon S3, in buckets that you can't access directly. |
| Contents of your EBS snapshots | You can read data from your snapshots, or use them to create volumes. |
Volumes
When you create an EBS volume, you select an Availability Zone for the volume. You
must attach an EBS volume to an EC2 instance in the same Availability Zone. You can
create volumes when you launch an EC2 instance, or create them first and then attach them to
an instance. If a volume is attached to an instance, its status is in-use.
If a volume is not attached to an instance, its status is available.
Why these matter
EBS root volumes contain the operating system for your EC2 instances. EBS data volumes can contain business critical data. You can list your EBS volumes across all Regions and whether they are attached to EC2 instances.
To get a summary of your EBS volumes across all Regions
You can use Amazon EC2 Global View to list your EBS volumes across all Regions.
-
Open the Amazon EC2 Global View console at https://console.amazonaws.cn/ec2globalview/home
. -
On the Region explorer tab, under Summary, check the resource count for Volumes, which includes the number of volumes and the number of Regions. Click the underlined text to see how the volume count is spread across Regions.
-
On the Global search tab, select the client filter Resource type = Volume. You can filter the results further by specifying a Region or a tag.
To describe the EBS volumes that are in use
Use the describe-volumes command.
You must run this command in each Region where you have EBS volumes.
The --filters parameter scopes the results to volumes that are in-use.
The --query parameter displays only the specified fields in the output.
You can include additional fields as needed.
aws ec2 describe-volumes \ --filters Name=status,Values=in-use \ --query "Volumes[].[VolumeId,Size,Attachments[0].InstanceId]" \ --output table
The following is example output. The columns are volume ID, volume size, ID of the attached instance, and the device name.
---------------------------------------------------------------------
| DescribeVolumes |
+------------------------+-----+-----------------------+------------+
| vol-0992ee65bec96de19 | 8 | i-00a7d9ec76a46a49f | /dev/xvda |
| vol-04d631d22047db1cb | 30 | i-0b1bf24fd4f297ab9 | /dev/sda1 |
...
...
| vol-0b811be5cbd1425cc | 100 | i-0a8d998154b320257 | /dev/xvde |
+------------------------+-----+-----------------------+------------+
To describe the EBS volumes that are not in use
In the previous command, modify the filter to find volumes with a status of
available as follows.
--filters Name=status,Values=available
If a volume is unused, you should determine whether it has data that you need. For example, you can delete volumes that were created for testing purposes or to troubleshoot an issue. A volume might also be available if the block device that attached the volume to the instance was configured to persist after instance termination. If this is the case, verify whether the data on the volume is still needed.
I/O performance
The volume type that you specify for an EBS volume determines its performance. Depending on the volume type, you can specify a combination of size, IOPS, and throughput for your volumes. For information about the maximum provisioned IOPS and throughput for each volume type, see Amazon EBS volume types.
Why this matters
After you determine the performance of your EBS volumes, you can decide the minimum specifications required for functionally equivalent storage.
To get information about the performance of your volumes
Use the describe-volumes
command to describe the performance for your volumes that are in use. The
--query parameter displays only the specified fields in the output.
You can include additional fields as needed. For information about EBS-optimized
performance, refer to Amazon EC2 instance type specifications in the
Amazon EC2 Instance Types Guide.
aws ec2 describe-volumes \ --filters Name=status,Values=in-use \ --query "Volumes[].[VolumeId,VolumeType,Iops,Throughput]" \ --output table
The following is example output. The columns are volume ID, volume type, IOPS, and throughput (MiB/s).
-------------------------------------------------
| DescribeVolumes |
+------------------------+------+-------+-------+
| vol-0992ee65bec96de19 | gp3 | 3000 | 125 |
| vol-04d631d22047db1cb | gp2 | 100 | None |
...
...
| vol-0b811be5cbd1425cc | gp3 | 3000 | 125 |
+------------------------+------+-------+-------+
Contents of your EBS data volumes
Amazon EBS does not have access to the data that you store on your EBS volumes. You are responsible for backing up your data volumes. For example, you can create point-in-time snapshots, known as EBS snapshots.
You can also connect to your EC2 instances and transfer files from your EBS volumes to your own computer. There are many tools available to help you do this. The following are examples.
Why this matters
If you have business critical data on your EBS volumes, you can copy it to functionally equivalent storage.
To transfer files from a volume attached to a Linux instance
Connect to your Linux instance and use SCP. For more information, see Transfer files using SCP.
To transfer files from a volume attached to a Windows instance
Connect to your Windows instance and use RDP. For more information, see Transfer files using RDP.
Snapshots
You can back up your EBS data volumes by creating EBS snapshots. You can create EBS snapshots using Amazon EBS, Amazon Data Lifecycle Manager, or Amazon Backup.
Why this matters
If you have business critical data on your EBS volumes, most likely you're creating backups in the form of EBS snapshots. You can find the most recent snapshots of your volumes and verify that they reflect the current data on the volumes.
To describe the snapshots for a specific volume
Use the describe-snapshots
command. The --filters parameter scopes the results to snapshots
for the specified volume. The --query parameter displays only the
specified fields in the output. You can include additional fields as needed.
aws ec2 describe-snapshots \ --filters Name=volume-id,Values=vol-00622ef8c2ac8b762\ --query Snapshots[*].[SnapshotId,CompletionTime,Description] --output table
The following is example output. The columns are snapshot ID, completion date, and whether the volume is encrypted.
-------------------------------------------------------------------------
| DescribeSnapshots |
+-------------------------+------------------------------------+--------+
| snap-0ad439c50efabb47c | 2024-07-12T03:36:27.952000+00:00 | False |
+-------------------------+------------------------------------+--------+
Contents of your EBS snapshots
You can't download or export the contents of an EBS snapshot to another format. However, you can access the data in your snapshots by using the EBS direct APIs, or by creating an EBS volume from the snapshot and transferring the files.
Why this matters
If you have business critical data on your EBS volumes, most likely you're creating backups in the form of EBS snapshots. You can retrieve this data and copy it to functionally equivalent storage.
Option 1: To read data from your snapshots
Use the EBS direct APIs.
Option 2: To create a volume from a snapshot and transfer the data
-
Use the create-volume command to create a volume from the snapshot.
aws ec2 create-volume \ --volume-typegp3\ --snapshot-idsnap-0ad439c50efabb47c\ --iops6000\ --availability-zoneus-east-2b -
Use the attach-volume command to attach the volume to an instance.
aws ec2 attach-volume \ --device/dev/sdf\ --instance-idi-0b1bf24fd4f297ab9\ --volume-idvol-1234567890abcdef0 -
Connect to your instance and format and mount the volume.
-
Transfer the files on the volume to your own computer.