Skip to main content

Choosing EBS Volumes and Instance Store

Pick the right EBS volume type for IOPS and cost, manage snapshots with Recycle Bin and Fast Snapshot Restore, and know when Instance Store wins.

Overview and What You Will Learn

Amazon EBS is network-attached block storage for EC2 that lives independently of the instance. Choose gp3 for almost everything, io2 when you need very high or guaranteed IOPS, and st1 or sc1 for large sequential workloads. EC2 Instance Store is local disk on the host: the fastest storage you can get, but its contents are lost when the instance stops or fails.

In this lab you will:

  • Compare the six EBS volume types and see why gp3 replaced gp2
  • Create, attach, format and mount a gp3 volume, then resize it online
  • Back up with snapshots and restore them, including the four-step process to encrypt an existing volume
  • Protect snapshots with Recycle Bin and speed up restores with Fast Snapshot Restore
  • Decide when Instance Store is the correct choice

Why This Matters in Production

Storage decisions feel invisible until they cause an incident. Picture a brokerage database on gp2 during market open: IOPS are tied to volume size, the volume is too small to provide enough IOPS, and transaction latency climbs under load. Moving to gp3 or io2 fixes it, because IOPS can be set independently of size. Or picture an engineer deleting a snapshot you need for restores: with Recycle Bin that is a recoverable mistake, and without it the snapshot is gone.

Core Principles

An EBS volume exists in a single Availability Zone, attaches to one instance at a time (except Multi-Attach), and is provisioned, so you pay for the size you allocate and not what you use. It is not a file system, so you format it yourself, and it is not shared storage, for which you use EFS.

flowchart TD Q{Workload?} -->|General, boot, dev| G([gp3]) Q -->|Database needs more than 16000 IOPS
or consistent latency| I([io2]) Q -->|Large sequential reads and writes| S([st1]) Q -->|Rarely accessed, cheapest| C([sc1]) Q -->|Scratch data, replicated data,
maximum local speed| L([Instance Store]) classDef ssd fill:#326CE5,color:#FFFFFF classDef hdd fill:#F97316,color:#FFFFFF classDef local fill:#8B5CF6,color:#FFFFFF classDef ask fill:#DBEAFE,color:#1E293B class G,I ssd class S,C hdd class L local class Q ask
Type Max IOPS Max throughput
gp3 16,000 1,000 MiB/s
gp2 16,000 250 MiB/s
io2 Block Express 256,000 4,000 MiB/s
io1 64,000 1,000 MiB/s
st1 (HDD) 500 500 MiB/s
sc1 (HDD) 250 250 MiB/s

Only SSD types (gp2, gp3, io1, io2) can be boot volumes. HDD types cannot. Limits depend on instance type and Region, so check the current EBS documentation for your case.

gp3 versus gp2 is the most important distinction. On gp2, IOPS equal 3 per GiB of size (minimum 100, up to 16,000), so a small volume gets few IOPS and you buy extra capacity just to get performance. On gp3, every volume includes 3,000 IOPS and 125 MiB/s regardless of size, and you can raise IOPS and throughput independently. gp3 is also about 20 percent cheaper per GB.

TEXT
Need 6,000 IOPS and 100 GiB of space:
gp2: provision 2,000 GiB to reach 6,000 IOPS (1,900 GiB wasted)
gp3: provision 100 GiB and set IOPS to 6,000

Delete on Termination is on by default for the root volume and off by default for additional volumes. Turn it off for roots that hold data you may need to recover.

io1 and io2 Multi-Attach lets up to 16 Nitro instances in the same AZ attach one volume. It is only safe with cluster-aware software that coordinates writes. Standard file systems such as ext4 and XFS are not cluster-aware, and sharing them between instances corrupts data.

Detailed Step-by-Step Practical Lab

Milestone 1: Create and Attach a gp3 Volume

The volume must be in the same AZ as the instance. IOPS and throughput are set separately from size.

Bash
export AWS_REGION=ap-south-1
export INSTANCE_ID=i-0abc123def456789
export AZ=ap-south-1a
VOLUME_ID=$(aws ec2 create-volume \
--volume-type gp3 --size 10 --iops 3000 --throughput 125 \
--availability-zone $AZ \
--tag-specifications 'ResourceType=volume,Tags=[{Key=Name,Value=devops-data}]' \
--query VolumeId --output text)
aws ec2 wait volume-available --volume-ids $VOLUME_ID
aws ec2 attach-volume \
--volume-id $VOLUME_ID --instance-id $INSTANCE_ID --device /dev/sdf
Milestone 2: Format, Mount and Persist

On Nitro instances the device appears as an NVMe name such as /dev/nvme1n1, not /dev/sdf. Check with lsblk instead of assuming.

Bash
lsblk
# NAME SIZE TYPE MOUNTPOINT
# nvme0n1 8G disk
# nvme1n1 10G disk <- the new volume
sudo mkfs -t xfs /dev/nvme1n1
sudo mkdir /data
sudo mount /dev/nvme1n1 /data
# Mount by UUID at boot, and do not hang the boot if the volume is missing
UUID=$(sudo blkid -s UUID -o value /dev/nvme1n1)
echo "UUID=$UUID /data xfs defaults,nofail 0 2" | sudo tee -a /etc/fstab
sudo mount -a
echo "Important production data" | sudo tee /data/critical.txt
df -h /data
Milestone 3: Resize and Retune Online

Elastic Volumes lets you change size, type, IOPS and throughput on a running volume. A volume can only grow, never shrink, and after a modification you must wait before changing it again (about six hours). After increasing size you must grow the file system too.

Bash
aws ec2 modify-volume --volume-id $VOLUME_ID --size 20 --iops 6000
aws ec2 describe-volumes-modifications --volume-ids $VOLUME_ID \
--query "VolumesModifications[].[ModificationState,Progress]" --output text
# optimizing is usable, completed means finished
# On the instance, grow the file system into the new space
sudo xfs_growfs -d /data
df -h /data

To migrate a gp2 volume to gp3, run modify-volume --volume-type gp3 with explicit IOPS. Check the volume's real IOPS usage first, because a gp2 volume with burst credits may be running above its baseline.

Milestone 4: Take and Restore Snapshots

Snapshots are incremental: the first copies everything and later ones store only changed blocks. You can delete an old snapshot safely, because AWS keeps the data that other snapshots still need.

Bash
SNAP_ID=$(aws ec2 create-snapshot \
--volume-id $VOLUME_ID \
--description "devops-data before upgrade" \
--query SnapshotId --output text)
aws ec2 wait snapshot-completed --snapshot-ids $SNAP_ID
# Restore to a new volume in any AZ of the Region
aws ec2 create-volume \
--snapshot-id $SNAP_ID --volume-type gp3 --availability-zone ap-south-1b
# Copy to another Region for disaster recovery (run against the destination Region)
aws ec2 copy-snapshot \
--source-region ap-south-1 --source-snapshot-id $SNAP_ID \
--description "DR copy" --region ap-southeast-1
# Share with another account
aws ec2 modify-snapshot-attribute \
--snapshot-id $SNAP_ID --attribute createVolumePermission \
--operation-type add --user-ids 999888777666

For rarely used snapshots, the Archive tier costs about 75 percent less. It has a 90 day minimum, and restoring takes 24 to 72 hours.

Bash
aws ec2 modify-snapshot-tier --snapshot-id $SNAP_ID --storage-tier archive

Do not rely on running these by hand. Use Amazon Data Lifecycle Manager or AWS Backup to take snapshots on a schedule, copy them across Regions and expire them automatically.

Milestone 5: Encrypt an Existing Volume

You cannot flip encryption on for an existing unencrypted volume. You copy through an encrypted snapshot instead.

Bash
# 1. Snapshot the unencrypted volume
SNAP_ID=$(aws ec2 create-snapshot --volume-id $VOLUME_ID --query SnapshotId --output text)
aws ec2 wait snapshot-completed --snapshot-ids $SNAP_ID
# 2. Copy the snapshot with encryption enabled
ENC_SNAP=$(aws ec2 copy-snapshot \
--source-region ap-south-1 --source-snapshot-id $SNAP_ID \
--encrypted --kms-key-id alias/devops-prod-key \
--query SnapshotId --output text)
aws ec2 wait snapshot-completed --snapshot-ids $ENC_SNAP
# 3. Create an encrypted volume from the encrypted snapshot
NEW_VOL=$(aws ec2 create-volume \
--snapshot-id $ENC_SNAP --volume-type gp3 --availability-zone ap-south-1a \
--query VolumeId --output text)
aws ec2 wait volume-available --volume-ids $NEW_VOL
# 4. Stop using the old volume, detach it, and attach the new one
sudo umount /data # on the instance
aws ec2 detach-volume --volume-id $VOLUME_ID
aws ec2 attach-volume --volume-id $NEW_VOL --instance-id $INSTANCE_ID --device /dev/sdf

Prevent the problem next time by turning on encryption by default. It is a per-Region setting, so enable it in every Region you use.

Bash
aws ec2 enable-ebs-encryption-by-default --region ap-south-1
aws ec2 get-ebs-encryption-by-default --region ap-south-1
Milestone 6: Protect Snapshots with Recycle Bin

Without Recycle Bin, a deleted snapshot is permanently gone. A retention rule keeps deleted snapshots recoverable for the period you choose.

Bash
aws rbin create-rule \
--retention-period RetentionPeriodValue=14,RetentionPeriodUnit=DAYS \
--resource-type EBS_SNAPSHOT \
--description "14 day snapshot recovery window"
# After an accidental delete
aws ec2 list-snapshots-in-recycle-bin
aws ec2 restore-snapshot-from-recycle-bin --snapshot-id $SNAP_ID
Milestone 7: Remove Restore Latency with Fast Snapshot Restore

A volume created from a snapshot loads its data lazily from S3, so the first read of each block is slow. This hurts when you restore a database and expect full speed. Fast Snapshot Restore pre-warms the snapshot in the AZs you choose, so new volumes perform fully at once.

Bash
aws ec2 enable-fast-snapshot-restores \
--availability-zones ap-south-1a ap-south-1b \
--source-snapshot-ids $SNAP_ID
aws ec2 describe-fast-snapshot-restores \
--filters Name=snapshot-id,Values=$SNAP_ID \
--query "FastSnapshotRestores[].[AvailabilityZone,State]" --output table
aws ec2 disable-fast-snapshot-restores \
--availability-zones ap-south-1a ap-south-1b --source-snapshot-ids $SNAP_ID

FSR is billed per minute for each snapshot in each AZ while it is enabled, and the number of snapshots with FSR per Region is limited, so enable it only for restore-critical snapshots and disable it afterward. If you skip FSR, read the whole volume once with a tool like fio or dd to initialize it before production use.

Milestone 8: Decide When Instance Store Is Correct

Instance Store is physical disk attached to the host. It has no network hop, so it delivers the highest IOPS and lowest latency EC2 offers, and the size and speed depend on the instance type (storage-optimized families such as i4i). The trade-off is durability.

Event Instance Store data
Reboot Kept
Stop, terminate, hibernate Lost
Host or disk failure Lost

Use it for caches, buffers, scratch space and for data that is already replicated, such as Kafka brokers and Elasticsearch or OpenSearch nodes, where losing one node is acceptable and the cluster rebuilds it. Do not use it for any single copy of data you cannot recreate.

Milestone 9: Clean Up
Bash
sudo umount /data # on the instance, and remove the fstab line
aws ec2 detach-volume --volume-id $NEW_VOL
aws ec2 delete-volume --volume-id $NEW_VOL
aws ec2 delete-volume --volume-id $VOLUME_ID
aws ec2 delete-snapshot --snapshot-id $SNAP_ID
aws ec2 delete-snapshot --snapshot-id $ENC_SNAP

Production Best Practices & Common Pitfalls

  1. Use gp3 for new volumes. It is cheaper than gp2 and decouples IOPS from size.
  2. Enable encryption by default in every Region. New volumes are then encrypted automatically.
  3. Automate snapshots. Use Data Lifecycle Manager or AWS Backup, and test restores.
  4. Enable Recycle Bin for snapshots. A 7 to 30 day window costs little and prevents permanent mistakes.
  5. Turn off Delete on Termination for data volumes and data-bearing roots.
  6. Match the type to the access pattern. st1 for sequential throughput, io2 for latency-sensitive databases.
  7. Mount by UUID with nofail. Device names change and a missing volume should not block boot.
  8. Treat Instance Store as disposable. Replicate or rebuild anything stored there.
Common Mistake

Using Instance Store for data that must survive. A stop, termination or host failure destroys it, with no snapshot and no recovery.

Common Mistake

Enabling Multi-Attach with ext4 or XFS. These file systems assume a single writer, and two hosts mounting the same volume will corrupt it.

Tip

Snapshot before any risky change, such as a resize, type change or upgrade. It takes minutes and gives you a clean rollback.

Remember

EBS is locked to one Availability Zone. To move data to another AZ, snapshot it and create a new volume there.

Quick Reference & Troubleshooting Commands

Command Description
aws ec2 describe-volumes List volumes
aws ec2 create-volume --volume-type gp3 Create a volume
aws ec2 modify-volume Change size, type, IOPS or throughput online
aws ec2 create-snapshot Back up a volume
aws ec2 copy-snapshot Copy or encrypt a snapshot
aws ec2 restore-snapshot-from-recycle-bin Recover a deleted snapshot
lsblk Show block devices on the instance
Symptom Likely cause and fix
Volume cannot attach Different AZ from the instance, snapshot and recreate in the right AZ
Disk missing after attach NVMe naming, check lsblk for the real device
Larger size not visible File system not grown, run growpart and xfs_growfs or resize2fs
Slow first reads after restore Lazy initialization, use Fast Snapshot Restore or pre-read the volume
IOPS throttling on gp2 IOPS tied to small size, move to gp3 and set IOPS
Cannot delete snapshot Referenced by an AMI, deregister the AMI first

Resources

AWS Direct Connect vs VPN: Run Both as Failover

AWS Direct Connect vs VPN: Run Both as Failover

Run AWS Direct Connect as primary and Site-to-Site VPN as BGP failover. Size the backup, set route preference and test it before an outage does.

10 min read•Aug 2026
Lambda vs Fargate vs EC2 Spot: The Cost Crossover

Lambda vs Fargate vs EC2 Spot: The Cost Crossover

Lambda vs Fargate vs EC2 Spot, at the crossover where Lambda stops being cheaper — 2026 pricing, invocation thresholds, and interruption math.

5 min read•Aug 2026
Secrets Manager vs Parameter Store vs Vault

Secrets Manager vs Parameter Store vs Vault

Secrets Manager vs Parameter Store vs Vault: cost math, rotation, dynamic secrets and a decision flow, plus the Vault, IBM and OpenBao licensing context.

10 min read•Aug 2026
AWS VPC Security: Hardening Every Layer

AWS VPC Security: Hardening Every Layer

Harden your AWS VPC in layers: subnets, Security Groups, NACLs, Flow Logs, endpoints, and IAM conditions, with CLI examples for production.

10 min read•Jul 2026
Event-Driven Architecture on AWS Explained

Event-Driven Architecture on AWS Explained

Build event-driven systems on AWS with SQS, SNS, EventBridge and Kinesis: fan-out, DLQs, idempotent consumers and queue-based scaling.

11 min read•Jul 2026
S3 vs RDS vs DynamoDB: Choosing AWS Storage

S3 vs RDS vs DynamoDB: Choosing AWS Storage

Choosing S3, RDS, or DynamoDB wrong costs you in performance, cost, and scalability. Here is a practical decision guide based on your actual access patterns.

5 min read•Jul 2026
AWS Cost Optimisation: 8 Actions That Cut Bills

AWS Cost Optimisation: 8 Actions That Cut Bills

Cut your AWS bill without re-architecting: eight ordered steps from anomaly alerts and tagging to rightsizing, VPC endpoints, Savings Plans and Spot.

11 min read•Jul 2026
EC2 vs Lambda vs Fargate: Choosing AWS Compute

EC2 vs Lambda vs Fargate: Choosing AWS Compute

Choose between EC2, Lambda and Fargate using traffic shape, state and runtime limits, with worked cost break-evens instead of rules of thumb.

11 min read•Jul 2026

Explore More in AWS Compute and Auto Scaling

All 6 Topics

Frequently Asked Questions

Is Choosing EBS Volumes and Instance Store free to learn on DevOps Network?

Yes - this topic, like everything on DevOps Network, is 100% free with no paywall or sign-up gate.

What does the Choosing EBS Volumes and Instance Store topic cover?

Pick the right EBS volume type for IOPS and cost, manage snapshots with Recycle Bin and Fast Snapshot Restore, and know when Instance Store wins.

Found a mistake, an outdated step or a broken link?