Day 12: AWS - EFS

satyam mishrasatyam mishra
3 min read

I Tried Amazon EFS – Shared Storage That Feels Like Magic

Today felt like I plugged a single USB drive into multiple servers — all at once.
Yup, I finally explored Amazon EFS (Elastic File System).

After playing around with EBS yesterday (which was awesome but very 1-to-1), I wanted to understand how AWS handles shared storage. Spoiler: EFS is wild.


What Even Is EFS?

Here's how I tried to make sense of it:

  • EBS = Hard disk for one EC2 instance

  • EFS = Network drive shared across multiple EC2s

Basically, it's a managed NFS (Network File System) that multiple EC2s can access at the same time — like a shared folder on a company network.

And the best part? It grows automatically, and you only pay for what you use.


Setting It Up (Not as Simple as I Thought)

I thought EFS would be as simple as EBS. It kind of was… but I hit a few snags.

Step 1: Created the EFS File System

  • From the EFS dashboard → Create File System

  • Gave it a name: my-first-efs

  • Selected VPC (same as my EC2)

  • Let AWS create the mount targets in all AZs (default is fine)

Boom. File system ready.


Step 2: Configured Security Group

This is where I fumbled.

EFS uses NFS protocol (port 2049).
So I had to edit my EC2's security group to allow inbound traffic on port 2049from the EFS mount target security group (or 0.0.0.0/0 for testing, but that’s not recommended in prod).


Step 3: Mounted the File System

AWS gives you CLI-ready mount commands in the console. Super handy.

I SSH’d into my EC2 and ran:

sudo yum install -y amazon-efs-utils   # or apt-get for Ubuntu
sudo mkdir /mnt/efs
sudo mount -t efs fs-XXXXXXX:/ /mnt/efs

And just like that — a shared folder appeared at /mnt/efs.

I created a test file inside:

echo "Hello from EFS!" > /mnt/efs/hello.txt

Then mounted the same EFS on another EC2 — and saw the same file. Mind blown.


What Makes EFS Cool

  • Shared access: Two (or more) EC2s can read/write to the same file system.

  • Scales automatically: No resizing needed like EBS.

  • Managed & serverless: No need to handle file servers or patches.

  • Backup & lifecycle policies built-in

It just works. If your app needs multiple servers sharing the same files (like media, logs, configs), this is gold.


What Tripped Me Up 😅

  • Security Groups: Port 2049 must be open to the EFS mount targets.

  • I forgot to install the amazon-efs-utils package and got mount errors.

  • Was confused by mount targets at first — but realized they’re just EFS endpoints in each AZ.


My Take

I didn’t think I’d be impressed by “just a file system” — but EFS genuinely surprised me.

If you’re building something with multiple servers, or you want to separate storage from compute, this is clean and powerful.


What’s Next?

Tomorrow, I’ll probably take a short detour into S3, since it’s technically storage too — but for totally different use cases. (Spoiler: it's not a file system, more like a giant object locker.)

Let’s see how deep the AWS rabbit hole goes.

0
Subscribe to my newsletter

Read articles from satyam mishra directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

satyam mishra
satyam mishra