Skip to content

AWS EBS & EFS — Block and File Storage

Beyond S3 (object storage), AWS offers two types of persistent storage for EC2 workloads:

  • EBS (Elastic Block Store) — Block storage attached to a single EC2 instance (like a hard drive)
  • EFS (Elastic File System) — Shared NFS file system accessible by many instances simultaneously

EBS provides network-attached block storage for EC2 instances. It’s the primary storage for the OS disk and application data.

In Azure terms: EBS = Azure Managed Disks

Type Description Use Case Max IOPS
gp3 (General Purpose SSD) Baseline 3,000 IOPS, configurable Boot volumes, general workloads 16,000
gp2 (General Purpose SSD, older) IOPS scales with size (3 IOPS/GB) General workloads (prefer gp3) 16,000
io2 Block Express High IOPS, 99.999% durability Mission-critical databases 256,000
io1 (Provisioned IOPS SSD) Consistent high IOPS IOPS-intensive databases 64,000
st1 (Throughput Optimized HDD) Low cost, sequential throughput Big data, log processing 500 MB/s
sc1 (Cold HDD) Lowest cost Infrequently accessed data 250 MB/s

gp3 is the recommended default — better performance than gp2 at lower cost.

Feature Description
Single-AZ EBS volumes are tied to a specific AZ
Snapshots Point-in-time backups stored in S3 (incremental)
Encryption AES-256 via KMS — encrypt at creation
Multi-Attach io1/io2 volumes can attach to up to 16 EC2 instances (same AZ)
Elastic Volumes Resize, change type, or adjust IOPS without downtime
Terminal window
# Create a snapshot
aws ec2 create-snapshot \
--volume-id vol-0abc123 \
--description "My backup snapshot"
# Copy snapshot to another region
aws ec2 copy-snapshot \
--source-region us-east-1 \
--source-snapshot-id snap-0abc123 \
--destination-region eu-west-1 \
--description "Cross-region backup"
# Create a volume from a snapshot
aws ec2 create-volume \
--snapshot-id snap-0abc123 \
--availability-zone us-east-1a \
--volume-type gp3
Feature AWS EBS Azure Managed Disks
SSD tiers gp3, io2, io1 Standard SSD, Premium SSD, Ultra Disk
HDD tiers st1, sc1 Standard HDD
Snapshots Yes (S3-backed, incremental) Yes (incremental)
Encryption AES-256 via KMS SSE via Azure Key Vault
Max size 64 TB 32 TB (most types)
Multi-attach io1/io2 only (16 instances) Ultra Disk (shared disks)

EFS is a fully managed, scalable NFS (Network File System) that can be mounted by thousands of EC2 instances, containers (ECS/EKS), and Lambda functions simultaneously.

In Azure terms: EFS = Azure Files (NFS/SMB shares)

Feature EBS EFS
Access Single EC2 instance (usually) Many instances simultaneously
Protocol Block (mounted as disk) NFS v4.1
AZ scope Single AZ Multi-AZ (Regional) or Single-AZ
Scaling Manual resize (Elastic Volumes) Automatic, scales to petabytes
Use case OS disk, databases Shared config, content, code
Pricing Provisioned size Pay per GB used
Class Description
Standard Frequently accessed files
Standard-IA Infrequently accessed (lower cost, retrieval fee)
One Zone Single AZ, lower cost
One Zone-IA Single AZ + infrequent access

Lifecycle policies automatically move files to IA after 7, 14, 30, 60, or 90 days.

Terminal window
# Install EFS mount helper
sudo yum install -y amazon-efs-utils
# Mount EFS filesystem
sudo mount -t efs -o tls fs-0abc123:/ /mnt/efs
# Add to /etc/fstab for persistence
fs-0abc123:/ /mnt/efs efs defaults,_netdev,tls 0 0

EFS is commonly used as shared storage for containerized apps:

  • ECS: Mount EFS volumes in task definitions
  • EKS: Use the EFS CSI driver to create PersistentVolumes with ReadWriteMany access mode
Need Choose
EC2 OS disk EBS gp3
High-performance database EBS io2
Shared files across many instances EFS
Large object storage (files, backups, media) S3
Long-term archive S3 Glacier
On-prem files to cloud AWS Storage Gateway