Day 11: AWS EBS


I Gave My EC2 a Hard Drive – Messing Around with EBS
Today, I finally took a proper look at Amazon EBS — the kind of storage that plugs inside an EC2 instance, like a hard drive. I’ve seen it pop up during instance launch a dozen times, but never really touched it.
Turns out, it’s actually pretty neat once you get the hang of it. Here's how it went.
Wait, What Is EBS Again?
So from what I understand now:
EBS (Elastic Block Store) is basically persistent block storage for EC2.
Think of it like a USB drive or SSD — but in the cloud.
It sticks around even if you stop your instance, and you can move it between instances if needed.
Not shared storage like EFS. This one’s more of a 1:1 deal — one EC2, one volume.
What I Tried Today
Created an EBS Volume
Started from the EC2 dashboard → Elastic Block Store → Volumes → Create Volume.
Picked 8 GiB (free-tier safe)
Type:
gp3
(default SSD type)Made sure it's in the same Availability Zone as my instance (
us-east-1a
)
This AZ thing caught me off guard at first — you have to keep the volume and instance in the same AZ, or they won’t talk.
Attached It to My EC2
From the volume screen → Actions → Attach Volume
Selected my test EC2
Device name auto-filled as
/dev/xvdf
Done. Simple.
Formatted and Mounted It
SSH-ed into my EC2 and checked if the volume showed up:
lsblk
Saw /dev/xvdf
there — cool. Then formatted it:
sudo mkfs -t ext4 /dev/xvdf
Made a folder and mounted the volume:
sudo mkdir /mnt/myvolume
sudo mount /dev/xvdf /mnt/myvolume
Dropped a file inside just to test. Everything worked.
But then I rebooted the instance... and the mount was gone. 😅
That’s when I remembered: EBS doesn’t auto-mount after a reboot.
Made the Mount Persistent
Edited /etc/fstab
to make the mount stick. Added this line:
/dev/xvdf /mnt/myvolume ext4 defaults,nofail 0 2
Rebooted, and it mounted automatically. Success!
💡 Random Things I Noticed
The mounting process feels very Linux-y — which I liked. Kind of makes you feel like you’re managing a real server.
You can create snapshots of EBS volumes for backups or duplication.
EBS can be detached and re-attached to other EC2s (but not while it’s in use).
It’s fast enough for basic stuff — installing a DB or serving files would totally work.
What Tripped Me Up
Forgot to match AZ when I created the volume → had to delete and redo it.
Didn’t realize EBS doesn’t auto-mount → fixed with
/etc/fstab
.Had to double-check if
gp3
was okay for free tier — it is.
My Take
EBS doesn’t look exciting on the surface, but it’s actually super practical.
It’s like giving your EC2 its own little toolbox or notepad that stays even if the machine shuts off. And for things like databases, apps, or anything that needs storage inside the server — EBS just makes sense.
🔜 Tomorrow: EFS – Shared Storage That’s Way More Chill
Subscribe to my newsletter
Read articles from satyam mishra directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
