EBS
Overview
Amazon Elastic Block Store (EBS) provides persistent block storage volumes for EC2 instances. An EBS volume behaves like a raw hard drive that you attach to an instance, format with a file system and mount. Unlike the instance store (physically attached, lost when the instance stops), EBS data survives instance stops and can be snapshotted.
An EBS volume lives in one Availability Zone and is replicated within that AZ for durability. It is attached over the network, so you can detach it from one instance and attach it to another in the same AZ. To move data to another AZ or Region you take a snapshot, which is stored durably in S3 (managed by AWS) and can be restored anywhere.
Choosing the right volume type is a recurring exam topic. SSD volumes (gp3, io2) serve transactional workloads such as databases and boot volumes, while HDD volumes (st1, sc1) serve large sequential workloads such as big data and logs at a lower price.
Key Concepts
- EBS volumes are AZ-scoped network block devices; they can only attach to instances in the same AZ. Use snapshots to move across AZs or Regions.
- gp3 (default SSD): baseline 3,000 IOPS and 125 MiB/s, scalable to 16,000 IOPS and 1,000 MiB/s independent of size; gp2 ties IOPS to size (3 IOPS/GiB).
- io2 / io2 Block Express (Provisioned IOPS): up to 256,000 IOPS, 64 TiB, sub-millisecond latency, 99.999% durability; io1 up to 64,000 IOPS.
- st1 (throughput-optimised HDD) and sc1 (cold HDD) are for sequential access and cannot be boot volumes.
- Snapshots are incremental, stored in S3, can be copied across Regions/accounts and automated with Data Lifecycle Manager (DLM) or AWS Backup.
- Encryption uses AES-256 with KMS: data at rest, in transit to the instance, snapshots and volumes created from them are all encrypted.
- Multi-Attach lets a single io1/io2 volume attach to up to 16 Nitro instances in the same AZ; the application must manage concurrent writes.
- Root volumes are deleted on termination by default; additional attached volumes are retained by default (the
DeleteOnTerminationflag).
Detailed Notes
Volume types
| Type | Category | Size | Max IOPS | Max throughput | Typical use |
|---|---|---|---|---|---|
| gp3 | General SSD | 1 GiB - 16 TiB | 16,000 | 1,000 MiB/s | Boot volumes, dev/test, most apps |
| gp2 | General SSD | 1 GiB - 16 TiB | 16,000 (3 IOPS/GiB, burst to 3,000) | 250 MiB/s | Legacy general purpose |
| io1 | Provisioned IOPS SSD | 4 GiB - 16 TiB | 64,000 | 1,000 MiB/s | Critical databases |
| io2 Block Express | Provisioned IOPS SSD | 4 GiB - 64 TiB | 256,000 | 4,000 MiB/s | SAP HANA, Oracle, SQL Server |
| st1 | Throughput HDD | 125 GiB - 16 TiB | 500 | 500 MiB/s | Big data, data warehouses, logs |
| sc1 | Cold HDD | 125 GiB - 16 TiB | 250 | 250 MiB/s | Infrequently accessed, lowest cost |
gp3 is about 20% cheaper than gp2 and decouples performance from capacity: you can buy 16,000 IOPS on a 100 GiB volume. Only SSD volumes (gp2, gp3, io1, io2) can be boot volumes.
EBS vs instance store
| EBS | Instance store | |
|---|---|---|
| Persistence | Survives stop/start | Lost on stop, terminate or hardware failure |
| Location | Network-attached | Physically on the host |
| Performance | Up to 256,000 IOPS | Very high IOPS, microsecond latency |
| Use | Databases, OS disks | Buffers, caches, scratch data |
Snapshots
- Snapshots are incremental: the first is a full copy of used blocks; later ones store only changed blocks. Deleting an old snapshot never breaks newer ones.
- They are crash-consistent; stop I/O or flush for application consistency.
- Copy snapshot to another Region for DR or to encrypt an unencrypted volume (snapshot -> encrypted copy -> new volume).
- Fast Snapshot Restore (FSR) removes first-access latency on restore.
- Snapshot Archive costs about 75% less, with a 90-day minimum and 24-72 hour restore.
- Recycle Bin protects against accidental snapshot deletion with retention rules.
- Data Lifecycle Manager schedules automatic snapshots and retention.
aws ec2 create-snapshot --volume-id vol-0abc123 \
--description "nightly backup" --tag-specifications \
'ResourceType=snapshot,Tags=[{Key=Backup,Value=daily}]'
aws ec2 copy-snapshot --source-region us-east-1 --source-snapshot-id snap-0abc123 \
--region eu-west-1 --encrypted --kms-key-id alias/dr-key
Encryption
When a volume is encrypted, data at rest, data moving between volume and instance, snapshots and volumes restored from snapshots are all encrypted, with no performance impact you can measure. You can turn on EBS encryption by default per Region. You cannot encrypt an existing volume in place and you cannot share an encrypted snapshot encrypted with the default AWS managed key; use a customer managed key and share the key.
Elasticity and operations
- You can increase size, change type and adjust IOPS on a live volume (Elastic Volumes); you can never decrease size. After resizing, extend the file system in the OS. There is a cool-down of about 6 hours between modifications.
- Multi-Attach works on io1/io2 only, requires Nitro instances in the same AZ and a cluster-aware file system (not ext4 or XFS).
- RAID 0 stripes volumes for performance; RAID 1 mirrors for redundancy (done in the OS).
- Monitor with CloudWatch metrics such as
VolumeQueueLengthandBurstBalance(gp2, st1, sc1).
Real World Example
Scenario — an online retailer runs a self-managed PostgreSQL cluster on EC2 for order processing.
During a flash sale the database needs sustained 40,000 IOPS with sub-millisecond latency. The team places the data files on io2 Block Express volumes provisioned at 40,000 IOPS and the WAL on a separate gp3 volume. Reporting uses a large st1 volume for nightly exports.
Everything is encrypted with a customer managed KMS key. Data Lifecycle Manager takes hourly snapshots retained for 48 hours and daily snapshots retained for 35 days, and the daily ones are copied to a second Region for disaster recovery. When the primary AZ has an issue, the team restores the latest snapshot in another AZ using Fast Snapshot Restore so the instance reaches full speed immediately. Mid-year, volumes are resized online with Elastic Volumes with no downtime.
Architecture Diagram
Volumes are bound to an AZ; snapshots stored in S3 move data between AZs and Regions.
- 1An EC2 instance in AZ A uses an encrypted EBS volume as its data disk over the network.
- 2Data Lifecycle Manager creates incremental snapshots on a schedule; they are stored durably in S3.
- 3To recover in AZ B, a new volume is created from the snapshot and attached to a replacement instance.
- 4For disaster recovery the snapshot is copied to another Region, optionally re-encrypted with a different KMS key.
Best Practices
- ✓Use gp3 instead of gp2 for new volumes: lower cost and independently tunable IOPS and throughput.
- ✓Reserve io2 / io2 Block Express for latency-sensitive databases that need more than 16,000 IOPS; do not over-provision otherwise.
- ✓Automate snapshots with Data Lifecycle Manager or AWS Backup and copy them to a second Region for DR.
- ✓Enable EBS encryption by default in every Region and use customer managed KMS keys when you need to share snapshots across accounts.
- ✓Choose EBS-optimised, Nitro-based instances whose instance-level IOPS and throughput limits match the volume, otherwise the instance becomes the bottleneck.
- ✓Use st1/sc1 only for large sequential workloads and never for boot volumes or random-I/O databases.
- ✓Set DeleteOnTermination deliberately for data volumes and use Recycle Bin retention rules to guard against accidental snapshot deletion.
- ✓Monitor
VolumeQueueLength,BurstBalanceand IOPS metrics in CloudWatch, and resize online with Elastic Volumes instead of migrating data.
Common Interview Questions
Exam Tips
SAA-C03 focus
- EBS is AZ-bound. Cross-AZ or cross-Region moves always go through snapshots.
- "Boot volume" or "general purpose" -> gp3 (or gp2). "More than 16,000 IOPS" or "critical database" -> io1/io2. "Big data, log processing, sequential" -> st1. "Lowest cost, infrequent" -> sc1.
- st1 and sc1 cannot be boot volumes. Only gp2, gp3, io1 and io2 can.
- Multi-Attach = io1/io2 only, same AZ, up to 16 Nitro instances. It is not a way to share storage across AZs (that is EFS).
- Need extremely high IOPS with microsecond latency and can lose data on stop -> instance store (ephemeral). Persistent data -> EBS.
- Encrypt an unencrypted volume = snapshot -> encrypted copy -> new volume. Encrypted snapshots can be shared only with a customer managed key.
- Snapshots are incremental, region-scoped and stored in S3; use Snapshot Archive to save ~75% on rarely restored snapshots (90-day minimum).
- You can grow volumes and change type online but you can never shrink an EBS volume.
Finished this lesson?
0 of 64 lessons done · 0% of the course

