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

TypeDescriptionUse CaseMax IOPS
gp3 (General Purpose SSD)Baseline 3,000 IOPS, configurableBoot volumes, general workloads16,000
gp2 (General Purpose SSD, older)IOPS scales with size (3 IOPS/GB)General workloads (prefer gp3)16,000
io2 Block ExpressHigh IOPS, 99.999% durabilityMission-critical databases256,000
io1 (Provisioned IOPS SSD)Consistent high IOPSIOPS-intensive databases64,000
st1 (Throughput Optimized HDD)Low cost, sequential throughputBig data, log processing500 MB/s
sc1 (Cold HDD)Lowest costInfrequently accessed data250 MB/s

gp3 is the recommended default โ€” better performance than gp2 at lower cost.

FeatureDescription
Single-AZEBS volumes are tied to a specific AZ
SnapshotsPoint-in-time backups stored in S3 (incremental)
EncryptionAES-256 via KMS โ€” encrypt at creation
Multi-Attachio1/io2 volumes can attach to up to 16 EC2 instances (same AZ)
Elastic VolumesResize, 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
FeatureAWS EBSAzure Managed Disks
SSD tiersgp3, io2, io1Standard SSD, Premium SSD, Ultra Disk
HDD tiersst1, sc1Standard HDD
SnapshotsYes (S3-backed, incremental)Yes (incremental)
EncryptionAES-256 via KMSSSE via Azure Key Vault
Max size64 TB32 TB (most types)
Multi-attachio1/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)

FeatureEBSEFS
AccessSingle EC2 instance (usually)Many instances simultaneously
ProtocolBlock (mounted as disk)NFS v4.1
AZ scopeSingle AZMulti-AZ (Regional) or Single-AZ
ScalingManual resize (Elastic Volumes)Automatic, scales to petabytes
Use caseOS disk, databasesShared config, content, code
PricingProvisioned sizePay per GB used
ClassDescription
StandardFrequently accessed files
Standard-IAInfrequently accessed (lower cost, retrieval fee)
One ZoneSingle AZ, lower cost
One Zone-IASingle 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
NeedChoose
EC2 OS diskEBS gp3
High-performance databaseEBS io2
Shared files across many instancesEFS
Large object storage (files, backups, media)S3
Long-term archiveS3 Glacier
On-prem files to cloudAWS Storage Gateway