Quickly Discover and Remove Unused EBS Volumes
Any Elastic Block Store volume created in your AWS account is adding charges to your monthly bill, regardless whether is being used or not.
If you have EBS volumes that are unattached to an EC2 instance or have very low I/O activity, consider deleting them.
Removing unattached/orphaned Elastic Block Store volumes will help you avoid unexpected charges on your AWS bill and halt access to any sensitive data available on these volumes, and it is very easy to do so!
To determine if there are any unattached and unused EBS volumes, perform either of the following methods:
Method 1, using AWS Console:
1. Login to the AWS Management Console.
2. Navigate to EC2 dashboard at https://console.aws.amazon.com/ec2/.
3. In the navigation panel, under Elastic Block Store, click Volumes.
4. To identify any unattached EBS volumes, check their status under State column:
If the status is in-use, the volume is currently attached and cannot be deleted. If the status is available, the volume is not attached to an EC2 instance and can be safely deleted.
Method 2, using AWS CLI:
- Run describe-volumes command (OSX/Linux/UNIX) via AWS CLI to determine if you have any unattached EBS volumes:
aws ec2 describe-volumes
--filters Name=status,Values=available
2. The command output should return a JSON object for each existing unattached volume:
{
"Volumes": [
{
"AvailabilityZone": "us-east-1a",
"Attachments": [],
"Encrypted": true,
"VolumeType": "gp2",
"VolumeId": "vol-e323363d",
"State": "available",
"Iops": 90,
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key
/d6c03026-b0bd-451e-a864-a68355f4f035",
"SnapshotId": "",
"CreateTime": "2016-04-05T06:46:09.653Z",
"Size": 30
}
]
}
Tada! Now go and remove those EBS volumes that doesn’t bring joy to your life!