Amazon Elastic Block Store
Disks for EC2
Block storage volumes attached to an EC2 instance (same AZ); data persists when the instance stops; back up with snapshots.
- Cost$ Low
- Difficulty●●●●●
- Costs money when idle?Yes
- Managed by AWS
- In examsCLF · SAA · SOA
Think of it asLike an external hard drive plugged into one computer.
Where does EBS fit?
Calls EBS
A real example, step by step
- You run a self-installed PostgreSQL on an EC2 instance and need a separate disk for the data.
- You create a 100 GB gp3 EBS volume in the same AZ as the instance, set suitable IOPS and attach it like a hard drive.
- If the instance reboots or is stopped, the data on EBS stays intact.
- Every night Data Lifecycle Manager takes a snapshot; snapshots store only the changes, so they cost less.
- To move the database to another AZ, you create a new volume from the snapshot in that AZ and attach it to a new instance.
When to use it
✓ Use it when
Operating system disks, self-managed databases on EC2.
✗ Avoid it when
Multiple servers need shared access → EFS; cheap, long-term file storage → S3.
Common uses
- Operating system disk for EC2
- Self-managed databases on EC2 that need high IOPS
- Back up with snapshots, restore to another AZ
EBS, EFS or S3?
| Storage type | Block (a disk) | File (a shared folder) | Object |
|---|---|---|---|
| Attached to | One EC2 instance in the same AZ | Many machines across AZs | Nothing; accessed via API |
| Billing | Provisioned size, even if unused | Data actually stored | Data actually stored + requests |
| Best for | Operating systems, databases | Shared folders | Files, backups |
What does it cost?
- Pricing model: Per provisioned GB-month (gp3 ~$0.08/GB, includes 3,000 IOPS and 125 MB/s) + extra IOPS/throughput purchased + snapshots (~$0.05/GB-month).
- Free tier: Older accounts: 30 GB for 12 months.
Billed by provisioned size, not used size; 'orphaned' volumes left behind after deleting EC2; snapshots piling up; still using gp2 (~20% more expensive than gp3).
EBS lives in one AZ: to move it to another AZ or region, go through a snapshot. Very fast temporary data you can lose when the instance stops → instance store. Many machines reading and writing one folder → EFS, not EBS.
Try real exam questions
1Do the Amazon EBS volumes persist independently from the running life of an Amazon EC2 instance?
- ANo.
- BOnly if instructed to when created.
- CYes.
Show answer
Correct answer: C
Yes. EBS is network storage that exists independently of the instance: you can detach a volume and attach it to another instance with the data intact.
2Can you encrypt EBS volumes?
- AYes, you can enable encryption when you create a new EBS volume using the AWS Management Console, API, or CLI.
- BNo, you should use a third-party software to perform raw block-level encryption of an EBS volume.
- CYes, but you must use a third-party API for encrypting data before it's loaded on EBS.
- DYes, you can encrypt with the special 'ebs_encrypt' command through Amazon APIs.
Show answer
Correct answer: A
Yes. Enable encryption when you create the EBS volume (in the Console, API or CLI), using a KMS key. No third-party software is needed, and there is no 'ebs_encrypt' command.
Frequently asked questions
What is the difference between EBS and instance store?
EBS is network-attached storage: data survives stopping or rebooting the instance, and you can take snapshots. Instance store is a disk physically attached to the host; it is very fast but loses its data when the instance stops or is terminated.
Which EBS volume type should I choose?
gp3 is the default choice for most applications and lets you set IOPS and throughput separately. io2 is for databases that need high, consistent IOPS. st1 and sc1 are low-cost HDD volumes for large sequential workloads such as logs or data processing.
Can several instances share one EBS volume?
Normally a volume attaches to one instance in the same AZ. Some io1/io2 volumes support Multi-Attach, but your application must coordinate concurrent writes. If you need a shared folder, use EFS instead.
What do AWS exams ask about EBS?
EBS volumes live in one AZ and move to another AZ or region through snapshots; encryption with KMS; choosing gp3 or io2; and the fact that snapshots and detached volumes keep costing money if you forget to delete them.