Amazon Elastic Block Store (EBS) provides block storage volumes for Amazon EC2 instances. A volume works like a virtual hard drive. You attach it to an instance, format it and use it for an operating system, a database or application files. Because the data lives on the volume rather than on the instance itself, it persists when the instance stops or restarts. This guide explains how EBS works, the volume types, snapshots, encryption and common pitfalls.
What EBS is (and why “elastic”)
EBS stands for Elastic Block Store. “Block” describes how the storage is presented: as fixed-size blocks that a file system or database reads and writes directly. “Elastic” refers to the ability to change a volume’s size, type and performance while it is attached, within service limits. AWS launched EBS in August 2008.
Compare this with object storage, where you store whole objects and update them by rewriting them. EBS is for data that changes in place, often many times per second.
Is EBS like a hard drive?
For the instance using it, largely yes. Once attached and formatted, an EBS volume looks like a local disk to the operating system. Under the hood, though, EBS is network-attached storage. Its latency and failure behavior differ from a physical drive, and a volume stays tied to the Availability Zone where it was created.
How EBS volumes work
- Each volume is created in one Availability Zone (AZ) and can attach only to instances in that same AZ.
- Data is replicated within that AZ, not across AZs. For resilience across AZs, use snapshots, application-level replication or a different service.
- An instance’s root volume usually holds its operating system. Additional volumes hold application or database data.
- By default, the root volume is deleted when the instance terminates (DeleteOnTermination is set to true). Additional volumes are not deleted by default.
EBS volume types
| Volume type | Category | Typical use |
|---|---|---|
| gp3 | General purpose SSD | The default choice for most workloads |
| gp2 | General purpose SSD | Older default; gp3 is usually better value |
| io2 Block Express | Provisioned IOPS SSD | Demanding, latency-sensitive databases |
| io1 | Provisioned IOPS SSD | Earlier high-performance option; io2 is preferred |
| st1 | Throughput optimized HDD | Large sequential workloads such as big data and logs |
| sc1 | Cold HDD | Infrequently accessed data at the lowest cost |
HDD volumes (st1 and sc1) cannot be used as boot volumes. Check the current EBS documentation for volume sizes and maximums, since AWS updates them.
Performance: IOPS and throughput
IOPS (input/output operations per second) and throughput determine how quickly a volume serves reads and writes. gp3 is the usual recommendation because it sets performance separately from size. Each gp3 volume starts with a baseline of 3,000 IOPS and 125 MiB/s, and you can provision more for an additional cost.
gp2 works differently. Its IOPS scale with size at 3 IOPS per GiB, with a minimum of 100 and a maximum of 16,000 per volume. Small gp2 volumes can burst above their baseline for a period.
Instance types also limit EBS bandwidth. A fast volume cannot deliver more than the instance supports, so check the instance’s EBS limits when you size a database.
Snapshots and backups
An EBS snapshot is a point-in-time copy of a volume. Snapshots are incremental. The first one copies all the data, and later ones store only the blocks that changed. AWS keeps snapshots in AWS-managed storage backed by S3, which you cannot see in the S3 console. You can:
- Create a new volume from a snapshot.
- Copy a snapshot to another Region for disaster recovery.
- Automate snapshot schedules with AWS Data Lifecycle Manager.
A volume restored from a snapshot loads its data lazily, so the first read of each block can be slow. For production restores, consider Fast Snapshot Restore, which costs extra, or read the whole volume once before cutting over.
For a broader backup plan, see What is cloud backup and how does it work?
Encryption
EBS supports AES-256 encryption with AWS KMS keys. Encryption covers data at rest, data moving between the instance and the volume, and snapshots taken from the volume. You can turn on encryption by default for a Region, so new volumes are encrypted automatically.
You cannot simply switch encryption off for a volume. For an existing unencrypted volume, the usual approach is to take a snapshot, copy it with encryption turned on, and create a new volume from the copy.
Multi-Attach
Multi-Attach lets one io1 or io2 volume attach to up to 16 Nitro-based instances in the same AZ at the same time. It requires a cluster-aware file system, such as GFS2 or OCFS2. Standard file systems such as ext4 and XFS are not built for concurrent writes from several hosts and can corrupt data if you use them this way.
EBS compared with other storage
| Option | Scope | Shared access | Persistence |
|---|---|---|---|
| Amazon EBS | One AZ | Usually one instance; Multi-Attach is limited | Persists independently of the instance |
| EC2 instance store | Attached to the physical host | One instance | Lost when the instance stops or terminates |
| Amazon EFS | Regional, redundant across AZs | Many Linux instances | Persistent |
| Amazon S3 | Regional, redundant across AZs | Through the API | Persistent |
Instance store is fast and temporary, which makes it suitable for scratch space or caches, not for data you need to keep.
What EBS costs
EBS bills for provisioned capacity, not used space. A 500 GiB gp3 volume is billed for 500 GiB whether or not it is full. Stopping an instance does not stop charges for its volumes. Snapshots are billed for the data they store.
For gp3 in US East (N. Virginia), the list price has been about $0.08 per GB per month. Prices vary by Region, so check the current EBS pricing page. Delete volumes you no longer need, and take a snapshot first if you might need the data later.
Common mistakes
- Expecting a volume to span AZs. A volume stays in its AZ.
- Confusing EBS with instance store. Instance store is temporary, and EBS is not.
- Treating snapshots as continuous replication. A snapshot is a point-in-time copy, so recent changes can be lost.
- Forgetting to extend the file system after a resize. Elastic Volumes can grow a volume while it is attached, but the operating system must then extend the partition and file system to use the space.
- Expecting to shrink a volume. EBS volumes cannot be made smaller. Copy the data to a smaller volume instead.
Related reading
- What are different AWS storage services? maps EBS next to S3, EFS and FSx.
- Amazon S3 explained covers the object storage side.
- Why use object storage instead of block storage? compares the two models in more depth.
- Types of cloud storage services gives the wider picture across providers.