Managing Oversized Ebs Volumes in Production
Oversized EBS volumes are common in production; here's how to diagnose, remediate, and prevent them effectively.
Oversized EBS volumes are common in production; here’s how to diagnose, remediate, and prevent them effectively.
Diagnosis
Start by identifying volumes where allocated space far exceeds actual usage. Use these methods:
- Check current usage:
df -h /mount/path # For mounted volumes - List EBS volumes:
aws ec2 describe-volumes --filters 'Name=attachment.instance-id,Values=i-1234567890' - Monitor via CloudWatch:
UseVolumeIdleWriteandVolumeIdleReadmetrics to spot underutilized volumes.
Remediation Workflow
- Create a snapshot of the oversized volume.
- Create a new volume from the snapshot with a smaller size (e.g., 100GiB → 50GiB).
- Attach the new volume to the same instance:
aws ec2 attach-volume --volume-id vol-1234567890abcdef0 --instance-id i-1234567890abcdef0 --device /dev/xvdf - Transfer data from old to new volume:
rsync -avx /mnt/old_volume/ /mnt/new_volume/ # OR use dd for block-level copy (slower, more thorough): dd if=/dev/xvdf of=/dev/xvdg bs=1M - Detach old volume and reattach new volume with the original device name.
- Expand the filesystem (if needed):
resize2fs /dev/xvdf # For ext4
Source thread: anyone else just leaving oversized EBS volumes alone because shrinking them sucks?

Share this post
Twitter
Google+
Facebook
Reddit
LinkedIn
StumbleUpon
Pinterest
Email