What Is Amazon EFS? Shared File Storage vs EBS vs S3
EBS is a USB disk stuck to one laptop. S3 is a locker where you drop files by name. EFS is a shared office network drive — many EC2s open the same folders at once over NFS.
What you'll learn in this chapter
- What EFS is and why shared files matter
- EFS vs EBS vs S3 decision table
- Performance and throughput modes (basics)
- Cost shape and when not to use EFS
1. Everyday example
Why do we need this?
A WordPress site on two EC2s behind an ALB must share wp-content/uploads. EBS cannot attach read-write to two instances in normal setups. S3 needs code changes. EFS mounts like a normal Linux folder on both.
What is it?
Amazon EFS (Elastic File System) is a managed NFSv4 file system. It grows and shrinks as you add or delete files. Multiple mounts across AZs are normal.
2. EFS vs EBS vs S3
| Need | Pick | Why |
|---|---|---|
| Boot disk / database data dir on one EC2 | EBS | Low latency block storage |
| Many EC2s need POSIX files + locks | EFS | NFS shared file system |
| Images, backups, static website, data lake | S3 | Object storage; cheapest at scale |
| Lambda needs a shared /mnt library | EFS + Lambda | Supported mount for large deps |
3. Modes you will hear in interviews
- Regional file system (default): data stored across AZs — use this.
- Performance: General Purpose (default) vs Max I/O (legacy large scale).
- Throughput: Bursting (default) vs Elastic vs Provisioned.
- Storage classes: Standard and Infrequent Access (lifecycle).
Ravindra Bagale's Tip
EFS is wonderful for shared folders and painful as a high-IOPS database disk. Keep MySQL data on EBS or Aurora, not EFS.
4. Cost shape
You pay for GB stored and for some throughput modes. Idle empty file systems still have tiny charges; delete lab file systems. Cross-AZ mount traffic can add data-transfer cost — mount from the same AZ when you can.
5. Interview angles
Q. Protocol?
NFSv4.
Q. EBS multi-attach vs EFS?
EBS multi-attach is special/limited; EFS is made for many clients.
Q. S3 vs EFS for WordPress uploads?
S3 needs plugin/SDK; EFS is a plain mount.
Q. Can Lambda use EFS?
Yes — configure a mount path.
Q. Encryption?
In transit (TLS mount) and at rest (KMS).
Try at home
- List three apps that need EFS and three that should stay on S3.
- Do the next chapter lab: mount EFS on EC2.
In short
- EFS = shared NFS file system on AWS.
- EBS = disks; S3 = objects; EFS = shared folders.
- Great for CMS uploads and shared home dirs.
- Delete unused file systems.
Practice Tasks
Shivneri Schools is a education business in Junnar. Kavita Shinde looks after its IT and cloud work. They count money in INR and run their AWS resources in the ap-south-1 Region. In the tasks below you do real jobs for them using what this lesson teaches. All names, account IDs, IP addresses and numbers are made up for practice.
0 / 10
Easy How many addresses in a /16?
Why: Picking a VPC size needs this count.
What to do: Shivneri Schools plans the VPC 10.64.0.0/16. How many IP addresses does it hold in total?
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy Port for SSH
Why: Security group rules need the right port.
What to do: Which TCP port must the security group open for SSH?
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Easy Show where you are
Why: Before you copy or delete anything, you must know which folder you are in.
What to do: Kavita Shinde logged in to the Shivneri Schools server and is not sure which folder the terminal is in. Print the current folder path.
- Find the Linux command that does this job.
- Add the options (like -r or -h) the task needs.
- Add the file names, folders or users in the right order.
- Use sudo if the job changes system files or users. Click Check answer.
Easy Read-only access to one bucket
Why: Least privilege: give only the actions and the bucket the job needs.
What to do: Write an identity policy that lets the user read objects (s3:GetObject) only in bucket shivnerischool-data.
- Start with { "Version": "2012-10-17", "Statement": [ ... ] }.
- In each statement write Effect, Action and Resource.
- Give only what the task needs (least privilege).
- Use double quotes and commas correctly. Click Check answer.
Easy List all files with details
Why: Hidden files (like .env) and file sizes or owners only show with the right options.
What to do: Show a long listing of every file, including hidden ones, in /var/www/shivnerischool.
- Find the Linux command that does this job.
- Add the options (like -r or -h) the task needs.
- Add the file names, folders or users in the right order.
- Use sudo if the job changes system files or users. Click Check answer.
Medium Create an EFS file system
Why: EFS is shared storage that many servers can mount at once.
What to do: Create an encrypted EFS file system with creation token shivnerischool-shared.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Medium Storage cost
Why: Storage is billed per GB-month.
What to do: 500 GB in S3 Standard at USD 0.023 per GB-month. Monthly cost in USD?
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Medium Usable IPs in an AWS /24 subnet
Why: AWS keeps 5 addresses in every subnet.
What to do: How many addresses can Shivneri Schools use for servers in subnet 10.64.1.0/24 on AWS?
- Write down the numbers the task gives you.
- Work it out step by step on paper.
- Type only the final answer in the box.
- Click Check answer.
Hard Create a mount target
Why: Servers in a subnet reach EFS through a mount target in that AZ.
What to do: Create a mount target for fs-0abc1234 in subnet subnet-0103da55255dbb1 with security group sg-0103c655255c4c3b2.
- Read the task and decide which AWS service it is about.
- Write aws, then the service name, then the operation (the action word).
- Add each needed flag (--name) followed by its value from the task.
- Flags can be in any order. Click Check answer.
Hard S3 lifecycle rule (JSON)
Why: Old files move to cheaper storage automatically.
What to do: Write lifecycle JSON: one Enabled rule, prefix logs/, transition to GLACIER after 90 days.
- Start from the top-level keys the task names.
- Indent child keys with 2 spaces (no tabs).
- Fill in each property with the value from the task.
- Click Check answer. Key order does not matter.
Revision, comparison and interview cards
Revise this lesson in a few minutes. Save the cards on your phone or download them as PNG files. The QR code on each card opens this lesson.







More cards: Ravi Sir's Cards.