Published on

Amazon EBS Cheat Sheet

Authors

Ultimate Amazon EBS Cheat Sheet (2025)

What is Amazon EBS?

Amazon Elastic Block Store (EBS) is AWS's high-performance block storage service designed for use with EC2 instances. EBS provides persistent storage volumes that can be attached to EC2 instances, offering the reliability and performance needed for mission-critical workloads.

Key Features & Benefits

  • Persistence: Data remains intact even after EC2 instance termination
  • High Availability: Automatically replicated within an Availability Zone (99.8%-99.999% durability)
  • Scalability: Easily resize volumes from 1GB to 16TB (up to 64TB for io2 Block Express)
  • Snapshots: Incremental point-in-time backups stored in S3
  • Encryption: Data-at-rest and in-transit encryption
  • Performance Optimization: Multiple volume types to match workload requirements
  • Elastic Volumes: Modify volume size, type, or performance without detaching

EBS Volume Types Comparison

SSD-Backed Volumes (For Transactional Workloads)

FeatureGeneral Purpose SSD (gp3)General Purpose SSD (gp2)Provisioned IOPS SSD (io2)Provisioned IOPS SSD (io1)
Best forLow-latency apps, dev/test, boot volumesVirtual desktops, medium-sized databasesCritical business applications requiring sub-millisecond latencyI/O-intensive database workloads
Size1GB - 16TB1GB - 16TB4GB - 16TB (64TB for Block Express)4GB - 16TB
Durability99.8%-99.9%99.8%-99.9%99.999%99.8%-99.9%
Max IOPS/Volume16,00016,00064,000 (256,000 for Block Express)64,000
Max Throughput1,000 MB/s250 MB/s1,000 MB/s (4,000 MB/s for Block Express)1,000 MB/s
Baseline Performance3,000 IOPS, 125 MB/s3 IOPS/GBUser-definedUser-defined
IOPS/GBN/AN/A500 (1,000 for Block Express)50
Multi-AttachNoNoYesYes

HDD-Backed Volumes (For Throughput-Intensive Workloads)

FeatureThroughput Optimized HDD (st1)Cold HDD (sc1)
Best forBig data, data warehouses, log processingInfrequently accessed data, lowest storage cost
Size125GB - 16TB125GB - 16TB
Durability99.8%-99.9%99.8%-99.9%
Max IOPS/Volume500250
Max Throughput500 MB/s250 MB/s
Multi-AttachNoNo

Important EBS Formulas

Burst Duration (gp2)

Burst duration = (Credit balance) ÷ [(Burst IOPS)3 × (Volume size in GiB)]

Throughput Calculation (gp2)

Throughput in MB/s = (Volume size in GiB) × (IOPS per GiB) × (I/O size in KB) ÷ 1024

Note: Maximum throughput is capped at 250 MB/s for gp2

Throughput Calculation (st1)

Throughput = (Volume size) × (Credit accumulation rate per TiB)

Best Practices

Volume Selection

  • gp3: Best balance of cost/performance for most applications
  • gp2: Legacy general purpose (consider gp3 for new deployments)
  • io2: For critical workloads needing highest durability and consistent IOPS
  • io1: Legacy high-performance (consider io2 for new deployments)
  • st1: Cost-effective for sequential, throughput-intensive workloads
  • sc1: Lowest cost option for infrequently accessed data

Performance Optimization

  • Use EBS-optimized instances when possible
  • For HDD volumes (st1/sc1), maintain large, sequential I/O operations
  • Initialize volumes created from snapshots before production use
  • Use a modern Linux kernel with current EBS drivers
  • Consider RAID 0 for increased performance (but not reliability)
  • Use Elastic Volumes to dynamically adjust performance

Data Protection

  • Enable EBS encryption by default for all new volumes
  • Create regular snapshots (automated with AWS Backup)
  • Copy snapshots across regions for disaster recovery
  • Use AWS Backup for centralized and automated backup management
  • Enable termination protection for critical EC2 instances

Snapshot Management

  • Snapshots are incremental (only changed blocks are saved)
  • Snapshots can be shared across AWS accounts
  • Snapshots can be copied across regions
  • You can create up to 10,000 snapshots by default
  • Delete snapshots you no longer need to save costs

Monitoring and Troubleshooting

CloudWatch Metrics to Monitor

  • VolumeReadOps / VolumeWriteOps: Track I/O operations
  • VolumeQueueLength: Check for bottlenecks
  • VolumeThroughputPercentage: For Provisioned IOPS volumes
  • VolumeConsumedReadWriteOps: For Provisioned IOPS volumes
  • BurstBalance: For gp2, st1, and sc1 volumes

Volume Status Checks

  • ok: Normal operation
  • warning: Degraded performance
  • impaired: Severely degraded or stalled
  • insufficient-data: Insufficient data available

Common EBS CLI Commands

# Create a new volume
aws ec2 create-volume --size 100 --availability-zone us-east-1a --volume-type gp3

# Attach a volume to an instance
aws ec2 attach-volume --volume-id vol-1234567890abcdef0 --instance-id i-01234567890abcdef --device /dev/sdf

# Create a snapshot
aws ec2 create-snapshot --volume-id vol-1234567890abcdef0 --description "Daily backup"

# Create volume from snapshot
aws ec2 create-volume --snapshot-id snap-1234567890abcdef0 --availability-zone us-east-1a --volume-type gp3

# Modify volume attributes
aws ec2 modify-volume --volume-id vol-1234567890abcdef0 --size 200 --iops 10000 --throughput 500

EBS Limitations

  • Volume limits: 5,000 EBS volumes per account by default
  • Snapshot limits: 10,000 snapshots per account by default
  • Snapshot copy requests: 5 concurrent requests to a single destination region
  • Volume size: Maximum 16 TiB (64 TiB for io2 Block Express)
  • Multi-Attach: Only available for io1/io2 volumes and limited to 16 Nitro-based instances

EBS Pricing Considerations

  • You pay for provisioned storage (GB-month) until you delete the volume
  • gp2/gp3/st1/sc1: Pay for provisioned storage
  • io1/io2: Pay for both provisioned storage and IOPS
  • Pricing is in per-second increments with a 60-second minimum
  • Snapshots are charged based on storage consumed in S3
  • Cross-region snapshot copying incurs additional costs
  • EBS optimization may incur additional fees (unless your instance type includes it by default)

Elastic Volumes Feature

  • Modify volume size, type, or performance without detaching
  • Available for all current-generation EBS volumes attached to current-generation EC2 instances
  • Volumes enter three states: Modifying → Optimizing → Complete
  • Can expand but not decrease size
  • For expanding partitions, use:
    • For MBR partitions: parted
    • For GPT partitions: gdisk
    • For ext2/3/4 filesystems: resize2fs
    • For XFS filesystems: xfs_growfs

AWS Backup Integration

  • Fully managed backup service for EBS and other AWS resources
  • Automated backup scheduling and retention policies
  • Centralized monitoring of backup and restore activities
  • Compliance reporting and audit capabilities

Best blog posts about Amazon EBS

  1. Official document: Amazon ebs fundamentals
  2. EBS security topic: Enhancing resource-level permissions for copying Amazon EBS snapshots
  3. Use case: ETL automation using AWS Transfer Family