SkillSprout
Chapter 6 · Lesson 1
Intermediate
7 min read

EBS and EFS Operations

Overview

Block and file storage are the workhorses behind servers. Amazon EBS provides network-attached block volumes for a single EC2 instance (or Multi-Attach for specific io1/io2 volumes), while Amazon EFS provides a shared, elastic NFS file system accessible from thousands of Linux instances at once.

An EBS volume is like a hard drive plugged into one computer by a very long cable; EFS is like a shared network drive in an office that grows as people add documents. Operationally the questions are: is the disk fast enough, big enough, backed up, and cost-efficient?

SysOps administrators resize volumes live, change volume types without downtime, snapshot and restore, and watch the metrics that reveal saturation.

Key Concepts

  • EBS volume types: gp3/gp2 (general SSD), io2/io1 (provisioned IOPS), st1 (throughput HDD), sc1 (cold HDD). gp3 baseline 3,000 IOPS / 125 MB/s independent of size.
  • Elastic Volumes: increase size, change type, IOPS or throughput while in use (6-hour wait between modifications); you cannot shrink a volume.
  • After growing a volume you must extend the partition and file system (growpart, resize2fs / xfs_growfs).
  • Snapshots are incremental, stored in S3, regional; copy cross-Region/account; fast snapshot restore (FSR) eliminates first-read latency; Recycle Bin protects against accidental deletes.
  • An EBS volume is tied to one AZ; move it by snapshot -> restore in another AZ.
  • Key EBS metrics: VolumeQueueLength, VolumeReadOps/WriteOps, BurstBalance (gp2/st1/sc1), VolumeThroughputPercentage / VolumeIdleTime; instance-level EBS limits can cap performance.
  • EFS performance modes: General Purpose (default) and Max I/O; throughput modes: Elastic (recommended), Provisioned, Bursting; storage classes Standard, IA, Archive with lifecycle management.
  • EFS mounts via mount targets (one per AZ) over NFSv4.1 using security groups on port 2049; EFS access points enforce user/path; FSx options cover Windows, Lustre, NetApp ONTAP, OpenZFS.

Detailed Notes

EBS volume selection

TypeUseMax IOPS / throughputBoot volume?
gp3Default, general workloads16,000 IOPS, 1,000 MB/sYes
gp2Legacy; burst credits tied to size (3 IOPS/GB)16,000 IOPSYes
io2 / io2 Block ExpressDatabases needing consistent low latency64,000 / 256,000 IOPSYes
st1Big sequential streams, logs, data warehouse500 MB/sNo
sc1Infrequently accessed archive250 MB/sNo

Migrate gp2 -> gp3 for cheaper baseline and decoupled IOPS.

Modify a volume live

bash
aws ec2 modify-volume --volume-id vol-0abc --size 200 --volume-type gp3 --iops 6000 --throughput 500
aws ec2 describe-volumes-modifications --volume-ids vol-0abc \
  --query "VolumesModifications[].[ModificationState,Progress]"

# On the instance (Linux, XFS root on NVMe)
lsblk
sudo growpart /dev/nvme0n1 1
sudo xfs_growfs -d /          # ext4: sudo resize2fs /dev/nvme0n1p1

Snapshot operations

bash
aws ec2 create-snapshot --volume-id vol-0abc --description "pre-upgrade" \
  --tag-specifications 'ResourceType=snapshot,Tags=[{Key=Env,Value=prod}]'
aws ec2 copy-snapshot --source-region us-east-1 --source-snapshot-id snap-0123 --region eu-west-1 --encrypted
aws ec2 enable-fast-snapshot-restores --availability-zones us-east-1a --source-snapshot-ids snap-0123
aws ec2 create-volume --availability-zone us-east-1b --snapshot-id snap-0123 --volume-type gp3

Use DLM or AWS Backup for scheduled snapshots, and multi-volume crash-consistent snapshots via create-snapshots for a database striped across volumes.

EBS performance troubleshooting

SymptomCheck
High latency, queue length > 1 per 1,000 IOPSVolume IOPS/throughput limit reached -> raise IOPS (gp3/io2)
gp2 slows after a whileBurstBalance exhausted; switch to gp3 or enlarge
st1 throughput lowSmall random I/O or burst credits depleted
Instance bottleneckEBS-optimised bandwidth of the instance type reached (check EBSIOBalance%, instance limits)
New volume from snapshot slow at firstLazy loading; use FSR or pre-initialise with fio/dd
Cannot attachVolume and instance must be in the same AZ

EFS operations

bash
aws efs create-file-system --performance-mode generalPurpose --throughput-mode elastic --encrypted \
  --tags Key=Name,Value=shared-app
aws efs create-mount-target --file-system-id fs-0abc --subnet-id subnet-a --security-groups sg-0efs
aws efs put-lifecycle-configuration --file-system-id fs-0abc \
  --lifecycle-policies TransitionToIA=AFTER_30_DAYS TransitionToPrimaryStorageClass=AFTER_1_ACCESS

# On an instance
sudo yum install -y amazon-efs-utils
sudo mount -t efs -o tls fs-0abc:/ /mnt/efs

/etc/fstab entry: fs-0abc:/ /mnt/efs efs _netdev,tls 0 0.

EFS troubleshooting

SymptomCause
Mount hangs/times outMount target SG does not allow TCP 2049 from the client; no mount target in that AZ; DNS not resolving
Throughput low (Bursting mode)Burst credits depleted (BurstCreditBalance) -> switch to Elastic/Provisioned
High latency for metadata-heavy workloadsConsider Max I/O (legacy) or redesign; check PercentIOLimit
Permission deniedPOSIX permissions / access point config / IAM authorisation on file system policy

Choosing a storage service

NeedService
Single-instance low-latency blockEBS
Shared POSIX file system for LinuxEFS
Windows SMB shares / AD integrationFSx for Windows
HPC / ML parallel file systemFSx for Lustre
Temporary scratch, highest IOPSInstance store (ephemeral!)
TypeBaseline / maxUse
gp33,000 IOPS and 125 MB/s included, up to 16,000 IOPS and 1,000 MB/s, independent of sizeDefault general purpose
gp23 IOPS/GB with burst creditsLegacy; migrate to gp3
io2 / io2 Block ExpressUp to 64,000 / 256,000 IOPSLatency-sensitive databases, Multi-Attach (io1/io2)
st1 / sc1Throughput-optimized / cold HDDBig sequential workloads
EFS modeChoices
ThroughputElastic (recommended), Provisioned, Bursting
PerformanceGeneral Purpose or Max I/O
Storage classesStandard, Infrequent Access, Archive with lifecycle policies
bash
aws ec2 modify-volume --volume-id vol-0abc --volume-type gp3 --iops 6000 --size 600
lsblk && sudo growpart /dev/nvme0n1 1 && sudo xfs_growfs -d /
aws ec2 create-snapshot --volume-id vol-0abc --description nightly
aws ec2 enable-ebs-encryption-by-default

Volumes can grow online but never shrink; after resizing you must extend the partition and file system. Snapshots are incremental and stored in S3; restored volumes load lazily (use Fast Snapshot Restore to avoid first-read latency). Encrypt an unencrypted volume by copying its snapshot with encryption. Instance EBS-optimized limits can cap throughput even when the volume is fast.

Real World Example

Scenario – database slows every afternoon. A reporting database on a 500 GB gp2 volume becomes sluggish after heavy queries. CloudWatch shows BurstBalance dropping to zero and VolumeQueueLength climbing. The volume's baseline is only 1,500 IOPS (3 IOPS/GB) and burst credits are exhausted.

The ops engineer runs modify-volume to convert to gp3 with 6,000 IOPS and 400 MB/s with no downtime. Latency drops, monthly cost falls slightly, and a CloudWatch alarm on queue length alerts if saturation returns. A DLM policy snapshots the volume nightly with cross-Region copy.

Architecture Diagram

EBS and EFS in a Multi-AZ web tier
Architecture
VPC
AZ-a
Instance A
EBS gp3boot + data
EFSshared content
AZ-b
Instance B
EBS gp3
Snapshots / Backup
  1. 1Each instance has its own EBS volumes in its AZ for OS and local data.
  2. 2EFS mount targets in each AZ give all instances a shared file system.
  3. 3CloudWatch monitors queue length, burst balance and throughput.
  4. 4Snapshots and AWS Backup protect both EBS and EFS data.

Best Practices

  • ✓Use gp3 by default and tune IOPS/throughput independently; use io2 for latency-sensitive databases.
  • ✓Automate snapshots with DLM/AWS Backup, tag them and copy cross-Region.
  • ✓Alarm on VolumeQueueLength, BurstBalance and BurstCreditBalance.
  • ✓Enable EBS encryption by default; encrypt EFS with KMS.
  • ✓Use EFS lifecycle to IA and Elastic throughput for variable workloads.

Common Interview Questions

Exam Tips

SOA-C03 focus

  • Resize or change type without downtime -> Elastic Volumes; shrinking is not possible.
  • Volumes are AZ-scoped; snapshots are Regional.
  • Shared storage across many Linux instances -> EFS; Windows file shares -> FSx for Windows.
  • gp2 slow after sustained load -> burst balance exhausted -> use gp3 or more provisioned IOPS.

Finished this lesson?

0 of 46 lessons done · 0% of the course