Ravindra BagaleCourses & study guides मराठी Track your progress

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.

Shared uploadsUser uploadsphoto via ALBEC2-A or EC2-Bhandles requestBoth mountsame EFS pathFile visibleon every instance
Same idea for CMS, home dirs, and shared ML feature files.

2. EFS vs EBS vs S3

NeedPickWhy
Boot disk / database data dir on one EC2EBSLow latency block storage
Many EC2s need POSIX files + locksEFSNFS shared file system
Images, backups, static website, data lakeS3Object storage; cheapest at scale
Lambda needs a shared /mnt libraryEFS + LambdaSupported 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

  1. List three apps that need EFS and three that should stay on S3.
  2. Do the next chapter lab: mount EFS on EC2.

In short

  1. EFS = shared NFS file system on AWS.
  2. EBS = disks; S3 = objects; EFS = shared folders.
  3. Great for CMS uploads and shared home dirs.
  4. Delete unused file systems.

Practice Tasks

About this scenario

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?

How:
  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. 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?

How:
  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. 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.

How:
  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. 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.

How:
  1. Start with { "Version": "2012-10-17", "Statement": [ ... ] }.
  2. In each statement write Effect, Action and Resource.
  3. Give only what the task needs (least privilege).
  4. 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.

How:
  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. 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.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. 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?

How:
  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. 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?

How:
  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. 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.

How:
  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. 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.

How:
  1. Start from the top-level keys the task names.
  2. Indent child keys with 2 spaces (no tabs).
  3. Fill in each property with the value from the task.
  4. 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.

Revision card: What is Amazon EFS?. Two EC2 web servers must see the same uploaded files. EBS attaches to one instance; S3 is object storage, not a classic file path. Amazon EFS is a managed NFS file system many EC2s (and some containers) can mount at once across AZs in a region. Create file system → mount targets in subnets → security group NFS 2049 → mount helper on Amazon Linux. echo hi > /mnt/efs/hello.txt on instance A; cat shows the same file on instance B.
Revision card: What is Amazon EFS? · Download PNG · Open card page
Revision card: When EFS wins vs EBS/S3. Wrong storage type breaks sharing or costs a fortune for the wrong access pattern. EBS: one instance block disk. EFS: shared POSIX files. S3: durable objects via API/SDK, not a drop-in /var/www. Shared CMS uploads, lift-and-shift NFS apps → EFS. Boot disks → EBS. Backups/static assets → S3. WordPress content directory on EFS across two web EC2s; AMI root still on EBS.
Revision card: When EFS wins vs EBS/S3 · Download PNG · Open card page
Revision card: EFS performance modes. Default settings are fine for labs; production needs the right throughput mode. General Purpose is the usual latency-sensitive default. Max I/O is for highly parallel scale. Throughput can be bursting or provisioned/elastic depending on config era. For class labs keep General Purpose and clean up the file system after the mount test. A student mount of a tiny hello.txt does not need Max I/O or provisioned TB.
Revision card: EFS performance modes · Download PNG · Open card page
Comparison: Amazon EFS vs Amazon EBS. Amazon EFS: NFS file system many instances can mount across AZs. Amazon EBS: Block volume typically attached to one instance.
Comparison: Amazon EFS vs Amazon EBS · Download PNG · Open card page
Comparison: Amazon EFS vs Amazon S3. Amazon EFS: POSIX file paths over NFS. Amazon S3: Object API (SDK/CLI/HTTP), not a drop-in filesystem.
Comparison: Amazon EFS vs Amazon S3 · Download PNG · Open card page
Interview card: Can multiple EC2s mount one EFS?. Yes — that is the point of EFS (NFS shared file system across AZs in the region). EBS volumes attach to one instance (with multi-attach only for special io2 cases). Create mount targets in each subnet/AZ; mount the same fs-id on every web EC2.
Interview card: Can multiple EC2s mount one EFS? · Download PNG · Open card page
Interview card: Why not S3 for /var/www files?. S3 is object storage via API; many legacy apps expect POSIX file paths and locking. EFS gives NFS paths; S3 shines for durable objects, static websites, and data lakes. Shared CMS uploads → EFS; static assets/CDN → S3 (+ CloudFront).
Interview card: Why not S3 for /var/www files? · Download PNG · Open card page

More cards: Ravi Sir's Cards.