5.4
EFS and Choosing Between EBS, EFS and Instance Store
A file system many instances share across AZs: modes, storage classes, lifecycle, and a decision table.
26 min Reading + animations
Tip: tap or hover any dotted-underlined term to see what it means.
By the end of this lesson you will be able to
- Tell block, file and object storage apart, and say which AWS service gives each one.
- Explain what Amazon EFS is: a managed NFS file system that many Linux instances in several Availability Zones mount at the same time.
- Connect instances to EFS through mount targets and security groups, and fix a mount that hangs.
- Choose between Regional and One Zone file systems, General Purpose and Max I/O, and the Elastic, Provisioned and Bursting throughput modes, using today’s AWS defaults.
- Use the Standard, Infrequent Access and Archive storage classes with lifecycle management, and work out what it really saves.
- Secure EFS with encryption, access points and IAM, protect it with AWS Backup and replication, and know when FSx is the answer instead.
- Pick EBS, EFS or instance store (or FSx) from any exam scenario.
#Three ways to store data
Lessons 5.1 to 5.3 covered two kinds of disk an EC2 instance can use: EBS volumes and instance store. Both are block storage. Before adding EFS, it helps to have one clear model of the three ways storage can be offered.
| Block storage | File storage | Object storage | |
|---|---|---|---|
| What you get | A raw disk made of numbered blocks. The operating system formats it with its own file system (ext4 on Linux, the Windows file system on Windows). | A ready-made file system with folders, file names, permissions and locks, reached over the network. | A flat bucket of objects, each with a key, the data and metadata, reached through an HTTP API. |
| Who can use it | Normally one instance at a time | Many instances at the same time | Any number of clients, from anywhere you allow |
| How you change data | Rewrite any block in place | Open, edit, append, lock, rename a file | Replace the whole object |
| AWS examples | EBS, instance store | EFS, FSx | S3 (chapter on S3) |
| Typical use | Boot volumes, databases | Shared folders, web content, home directories | Backups, media, data lakes, static websites |
#What Amazon EFS is
Amazon Elastic File System (EFS) is a managed network file system. You create a file system, and EC2 instances mount it with the standard Linux NFS client, exactly like a shared drive on an office network. AWS runs the servers, the disks, the replication and the scaling.
- Protocol: NFS version 4.0 and NFSv4.1, over TCP port 2049.
- Shared: hundreds or thousands of instances can mount the same file system at once and read and write the same files. Containers and Lambda functions can mount it too, and on-premises servers can reach it over Site-to-Site VPN or Direct Connect.
- Across AZs: a Regional file system stores its data redundantly in at least three Availability Zones, and instances in every AZ of the Region can use it at the same time.
- Linux only: EFS works with Linux instances (and EC2 Mac instances). It is not supported on Windows. It behaves like a Linux file system: POSIX permissions (owner, group, read/write/execute), directories, and NFSv4 file locking.
- Elastic size: there is no size to choose. The file system grows when you add files and shrinks when you delete them, up to petabytes. You never run out of space and never pay for empty space.
- Pay per use: you pay for the GB you actually store each month (plus, depending on the throughput mode, for throughput). There is nothing to provision.
#How instances reach EFS: mount targets
An EFS file system lives at Region level, but instances live in subnets. The bridge between them is a mount target.
One mount target per AZ
A mount target is a network interface that EFS places in one subnet of your VPC, with a private IP from that subnet. A Regional file system can have one mount target in each AZ (never two in the same AZ). Create one in every AZ where instances will mount the file system; mount targets are free.
A security group on the mount target
Each mount target has one or more security groups. The rule that matters is inbound TCP 2049 (NFS) from the instances, best written with the instances’ security group as the source. The instances need outbound 2049 to the mount target, which the default “allow all outbound” rule already gives.
Mount by name
On the instance you mount the file system by its DNS name,
fs-0abc1234.efs.us-east-1.amazonaws.com. Inside the VPC (with DNS resolution and DNS hostnames turned on) that name resolves to the mount target in the instance’s own AZ, so the traffic stays inside the AZ. The easiest way is the EFS mount helper (theamazon-efs-utilspackage):sudo mount -t efs -o tls fs-0abc1234:/ /mnt/efs.
| Security group | Direction | Protocol and port | Source / destination |
|---|---|---|---|
Instances (sg-web) | Outbound | TCP 2049 | The mount target security group (default outbound already allows it) |
Mount target (sg-efs) | Inbound | TCP 2049 | sg-web (or the instances’ CIDR range) |
Mounting through a mount target in another AZ works, but each GB that crosses the AZ boundary costs the usual cross-AZ data transfer ($0.01 per GB in each direction) and adds latency. Use the local mount target.
One file system, mounted from three AZs
EFS lives at Region level. Each AZ gets one mount target (a network interface in a subnet), and instances reach the file system through the mount target in their own AZ on NFS port 2049.
Scenario
One EFS file system and three web servers in three AZs. Each AZ has its own mount target with an IP from that AZ’s subnet.
#When the mount hangs
A blocked NFS port does not produce a neat “access denied”. A security group simply drops the packets, so the mount command waits and then fails with “Connection timed out”. Check, in this order:
| Symptom | Likely cause | Fix |
|---|---|---|
mount hangs, then Connection timed out | Mount target security group has no inbound TCP 2049 from the instance | Add inbound 2049 with the instance’s security group as the source |
| Same, but the security groups look right | A network ACL on either subnet blocks 2049, or the return traffic on high ports | Allow 2049 and the ephemeral return ports in both NACLs (they are stateless) |
Failed to resolve the file system name | No mount target in the instance’s AZ, or DNS hostnames / DNS resolution off in the VPC | Create a mount target in that AZ; turn on DNS support; or mount a mount target by IP (paying cross-AZ) |
unknown filesystem type 'efs' | The mount helper is not installed | Install amazon-efs-utils (or use the plain NFS client with the NFSv4.1 options) |
access denied by server | The file system policy (IAM) refuses this client, for example because it did not use TLS or IAM | Mount with -o tls,iam and give the instance role the right EFS permissions |
#What EFS costs, compared with EBS
EFS charges for the average GB stored per month, in each storage class. Prices below are for us-east-1 at the time of writing; other Regions differ, so always check the pricing page.
| Item | Price (us-east-1) |
|---|---|
| EFS Standard, Regional | $0.30 per GB-month |
| EFS Standard, One Zone | $0.16 per GB-month |
| EFS Infrequent Access (IA), Regional | $0.016 per GB-month with Elastic throughput ($0.025 with Bursting or Provisioned) |
| EFS One Zone-IA | $0.0133 per GB-month |
| EFS Archive (Regional only) | $0.008 per GB-month |
| Reading from IA / tiering into IA | $0.01 per GB |
| Reading from Archive / tiering into Archive | $0.03 per GB |
| Elastic throughput | $0.03 per GB read, $0.06 per GB written |
| Provisioned throughput | $6.00 per MiB/s-month, above what Standard storage includes |
| For comparison: EBS gp3 | $0.08 per GB-month provisioned (lesson 5.2) |
So per GB, EFS Standard costs almost four times as much as gp3. That is the note’s point that “EFS storage is a bit expensive”. But compare the whole picture:
- With EBS you pay for the size you provision, used or not. A 1 TB gp3 volume holding 400 GB still costs $80.
- With EFS you pay only for the GB actually stored, and nothing is ever full.
- Three instances that each need the data would need three EBS volumes (and a way to keep them in sync). One EFS file system serves all of them.
- With lifecycle management (below), cold files drop to IA or Archive and the average price per GB falls a long way.
#Regional or One Zone
When you create a file system, you choose its type:
| Regional (recommended, default) | One Zone | |
|---|---|---|
| Where the data lives | Redundantly across at least 3 AZs | Redundantly inside one AZ |
| Survives an AZ failure | Yes, instances in the other AZs carry on | No, data is unavailable and could be lost if the AZ is damaged |
| Mount targets | One per AZ | One, in its own AZ (other AZs can reach it, paying cross-AZ) |
| Durability (designed for) | 11 nines | 11 nines (against disk, host and rack failures, not AZ loss) |
| Availability SLA (Standard) | 99.99% | 99.9% |
| Storage classes | Standard, IA, Archive | One Zone, One Zone-IA (no Archive) |
| Price | $0.30 per GB-month Standard | About half: $0.16 per GB-month |
| Automatic backups | On by default in the console | On by default in the console, CLI and API |
| Good for | Production, anything that must stay available | Dev/test, analytics scratch, data you can rebuild or that has another copy |
The notes call One Zone a “storage class”. In today’s console it is a file system type you pick at creation; it cannot be changed later. The two One Zone storage classes inside it are One Zone and One Zone-IA.
Regional vs One Zone when an AZ fails
A Regional file system stores data in at least three AZs. A One Zone file system stores it in one AZ, for about half the price.
Scenario
A Regional file system with a mount target in each AZ. Every write is stored redundantly across several AZs before EFS confirms it.
#Performance: performance mode and throughput mode
Two separate settings decide how fast a file system is.
#Performance mode: always General Purpose
| General Purpose | Max I/O | |
|---|---|---|
| Status | Default and recommended for every file system | Previous generation |
| Latency | Lowest per operation (about 1 ms reads, about 2.7 ms writes on Regional) | Higher per operation |
| Restrictions | None | Not supported with Elastic throughput or One Zone file systems |
| Can it be changed later? | No, chosen at creation | No |
Older courses say “use Max I/O for big data and thousands of instances”. That advice is out of date: General Purpose with Elastic throughput now reaches hundreds of thousands of read operations per second (and more on request), so AWS recommends General Purpose everywhere. If an exam option still offers Max I/O for “highly parallel, can tolerate higher latency”, recognise it as the legacy answer.
#Throughput mode: how many MiB per second
| Elastic | Provisioned | Bursting | |
|---|---|---|---|
| How throughput is set | Scales up and down automatically and instantly with demand | You set a number of MiB/s, independent of size | Scales with the size stored in Standard: 50 MiB/s baseline per TiB, burst to 100 MiB/s per TiB (minimum burst 100 MiB/s) using burst credits |
| You pay for | GB transferred ($0.03 read, $0.06 written per GB) | The MiB/s provisioned above the baseline your storage includes, every hour | Nothing extra; included in storage |
| Best for | Spiky or unpredictable workloads, or average use of 5% of peak or less | Known, steady throughput, or average use above about 5% of peak | Throughput that naturally grows with the data |
| Default? | Default in the console and recommended | No | Default only through the CLI/API if you omit the setting |
| Watch out | Monitor the transferred bytes so a runaway job does not run up the bill | After switching to Provisioned or raising it, you must wait 24 hours to lower it or switch away | A small file system has a tiny baseline; when credits run out it slows to that baseline |
A few numbers to feel Bursting: 100 GiB in Standard earns about 5 MiB/s of write baseline (reads are metered at one third, so about 15 MiB/s). After a quiet day it has enough credits to burst at 100 MiB/s for about 72 minutes. File systems over 1 TiB can burst half of the time. Every file system gets at least 1 MiB/s.
The ceilings are much higher with Elastic. A Regional file system on Elastic throughput can read at 20–60 GiB/s and write at 1–5 GiB/s in total, depending on the Region, compared with 3–5 GiB/s reads on Bursting. A single client tops out at 1,500 MiB/s with the current EFS mount helper (500 MiB/s otherwise). Older slides quote 3 GiB/s reads and 1 GiB/s writes for Elastic; those limits have since been raised.
Throughput modes under a spike
A nightly job suddenly needs 100 MiB/s from a small file system that holds 100 GiB in Standard. Watch what each throughput mode does.
Scenario
Bursting gives 50 MiB/s of baseline per TiB stored in Standard. 100 GiB earns only about 5 MiB/s of write baseline (reads are metered at a third, so about 15 MiB/s).
Self-checkQuestion
A media company stores 200 GiB of project files on EFS with Bursting throughput. Editors work normally all day, but a render job that starts every few days needs very high throughput for an unpredictable number of hours and then stops. Which change gives the best performance with the least management?
#Storage classes and lifecycle management
Most files are busy for a few days or weeks and then hardly ever opened again. EFS lets that cold data sit in cheaper storage classes without any change for the application.
| Storage class | Designed for | First-byte latency | Price (us-east-1, Regional) | Notes |
|---|---|---|---|---|
| Standard | Active files | Sub-millisecond (SSD) | $0.30 per GB-month | All new data lands here |
| Infrequent Access (IA) | Files read a few times a quarter | Tens of milliseconds | $0.016 (Elastic) or $0.025 per GB-month | $0.01 per GB to read or to tier in; files billed at least 128 KiB |
| Archive | Files read a few times a year or less | Tens of milliseconds | $0.008 per GB-month | Regional and Elastic throughput only; $0.03 per GB to read or tier in; 90-day minimum storage charge |
| One Zone | Active files, One Zone type | Sub-millisecond | $0.16 per GB-month | |
| One Zone-IA | Cold files, One Zone type | Tens of milliseconds | $0.0133 per GB-month |
#Lifecycle policies
Lifecycle management moves files between classes based on how long ago each file was last accessed in Standard. A file system has three lifecycle policies:
| Policy | Choices | Console default |
|---|---|---|
| Transition into IA | After 1, 7, 14, 30, 60, 90, 180, 270 or 365 days without access, or never | 30 days |
| Transition into Archive | After 1 to 365 days without access (same steps), or never | 90 days |
| Transition into Standard | On first access, or None | None: a file stays in IA or Archive when read |
Details that exam questions and bills both care about:
- EFS uses its own access timer, reset whenever a file in Standard is read or written. Metadata operations such as listing a directory or checking attributes do not count as access.
- File names, ownership and the directory tree always stay in Standard, so browsing feels the same.
- Writes to a file in IA or Archive go to Standard first and become eligible to move again 24 hours later.
- With Transition into Standard = None, every read of a cold file pays the access charge and the higher latency. Set On first access for files that may become hot again (for example many small files read by an application), so the file moves back and later reads are fast and free of access charges.
- A file system created through the CLI or API has no lifecycle policy until you add one with
put-lifecycle-configuration. - Policies apply to the whole file system, not per folder.
Lifecycle: a file cools down, then is read again
Console defaults: into IA after 30 days without access, into Archive after 90 days, and no move back to Standard. Prices are us-east-1 per GB-month.
Scenario
Every new file is written to Standard first: SSD-backed, sub-millisecond reads.
#Worked example: does IA really save 92%?
The notes say EFS-IA costs about 92% less than regular EFS. Check it against today’s us-east-1 prices:
- IA on a Bursting or Provisioned file system: $0.025 ÷ $0.30 = 8.3%, so about 92% less. The note is right for that case.
- IA on an Elastic file system (the console default): $0.016 ÷ $0.30 = 5.3%, so about 95% less.
- Archive: $0.008 ÷ $0.30 = 2.7%, so about 97% less.
That is the price per GB. The saving on the bill is smaller, because hot data stays in Standard and cold data has access charges. Take a 1,000 GB Regional file system with Elastic throughput, where only 200 GB is touched in any given month:
| Storage per month | Notes | |
|---|---|---|
| No lifecycle | 1,000 × $0.30 = $300.00 | |
| IA after 30 days | 200 × $0.30 + 800 × $0.016 = $60.00 + $12.80 = $72.80 | One-time tiering 800 × $0.01 = $8. Reading 50 GB a month back from IA adds $0.50. |
| IA after 30 days, Archive after 90 days (500 GB untouched for 90+ days) | 200 × $0.30 + 300 × $0.016 + 500 × $0.008 = $60.00 + $4.80 + $4.00 = $68.80 | One-time tiering: 300 × $0.01 + 500 × $0.03 = $18. Archive reads cost $0.03 per GB. |
So lifecycle cuts this bill by about 76%, not 92%, and the Archive step adds a little more. (Elastic throughput charges for reads and writes are the same in every row, so they are left out.) The more of your data is truly cold, the closer you get to the per-GB figure; on data that is touched every week, access and tiering charges can eat the saving.
#Security
#Encryption
- At rest: EFS encrypts data and metadata with an AWS KMS key, the AWS managed key
aws/elasticfilesystemor your own customer managed key. The console turns it on by default; through the CLI or API you must ask for it (--encrypted). It can be set only when the file system is created. To encrypt an existing unencrypted file system, create a new encrypted one and copy the data across. - In transit: mount with the EFS mount helper and the
tlsoption. The helper wraps the NFS traffic in TLS 1.2 (still on port 2049). To make TLS compulsory, add a file system policy that denies access whenaws:SecureTransportis false; the console offers this as “Enforce in-transit encryption for all clients”.
#Who may mount and what they may do
Three layers work together:
- Network: security groups and NACLs decide which machines can reach port 2049 at all.
- IAM: an EFS file system policy (a resource policy) plus the instance’s IAM role decide whether a client may mount, write, or act as root (
ClientMount,ClientWrite,ClientRootAccess). Mount with-o tls,iamso the client presents its IAM identity. Ready-made options include preventing root access, enforcing read-only access and denying anonymous access. - POSIX permissions: inside the file system, normal Linux owner, group and mode bits apply, just as on a local disk.
#Access points
An access point is an application-specific entry into the file system. It can:
- force every request through it to use a fixed POSIX user ID and group ID, whatever the client claims;
- expose only one directory as the root (for example
/apps/billing), creating it with chosen owner and permissions if it does not exist; - be named in IAM policies, so the billing application’s role may mount only the billing access point.
Access points are the clean way to let several applications, containers or Lambda functions share one file system without seeing each other’s data.
#Protection: backups and replication
- AWS Backup: daily incremental backups with 35-day retention under the default EFS backup plan. Automatic backups are on by default for file systems created in the console, and for One Zone file systems from any tool; for Regional file systems created by CLI/API, turn them on (
--backup). Restores can bring back the whole file system or single files, to a new or existing file system, even in another AZ or Region. Restored files land in Standard. - EFS Replication: keeps a read-only copy of the file system in another Region (or the same Region), continuously, with a recovery point objective of 15 minutes for most file systems. In a disaster you fail over by deleting the replication configuration, which makes the copy writable, and point clients at it. The copy can be Regional or One Zone.
#EFS or FSx?
EFS is the general-purpose shared file system for Linux. Amazon FSx offers fully managed versions of other well-known file systems for the cases EFS does not cover. The details come in a later chapter; for now know the two that appear most:
| Need | Service |
|---|---|
| Shared files for Linux, many instances, several AZs, pay per use | Amazon EFS |
| Shared files for Windows: SMB, Active Directory, Windows permissions (also usable from Linux over SMB) | Amazon FSx for Windows File Server |
| HPC and machine learning: a parallel file system with very high throughput, often linked to an S3 bucket | Amazon FSx for Lustre |
#Choosing between EBS, EFS and instance store
#The full comparison
| Instance store | EBS | EFS | |
|---|---|---|---|
| Type | Local physical block storage on the host | Network block storage | Network file storage (NFS) |
| Persistence | Temporary: lost on stop, hibernate, terminate or host failure; survives a reboot (lesson 5.3) | Persistent until you delete the volume (root volumes are deleted on terminate by default, lesson 5.1) | Persistent until you delete the files or the file system |
| Attach scope | Only the one instance on that host | One instance at a time (io1/io2 Multi-Attach: up to 16 Nitro instances, same AZ) | Hundreds or thousands of instances at once |
| AZ scope | The host | One AZ; copy to another AZ only through a snapshot | Regional: every AZ of the Region (One Zone: one AZ) |
| Operating systems | Linux and Windows | Linux and Windows | Linux only (Windows → FSx for Windows) |
| Performance | Highest IOPS, lowest latency (local NVMe) | Predictable; you choose type, size, IOPS and throughput (gp3, io2, st1, sc1) | Network file system latency (about 1 ms reads); throughput Elastic, Provisioned or Bursting |
| Size | Fixed by the instance type | You provision it; grow it with Elastic Volumes | Grows and shrinks automatically |
| Cost | Included in the instance price | Per GB provisioned (gp3 $0.08) plus extra IOPS/throughput | Per GB stored ($0.30 Standard, much less in IA/Archive) plus throughput charges in Elastic/Provisioned |
| Backup | None built in; copy the data yourself | EBS snapshots, Data Lifecycle Manager, AWS Backup | AWS Backup, EFS Replication |
| Best use cases | Cache, buffer, scratch, temporary data, replicated databases that rebuild a node | Boot volumes, databases, any single-instance application data | WordPress / CMS content, shared directories, home directories, web serving fleets, container and Lambda shared storage |
Which storage fits?
Answer four questions about the data. The answer changes as you click, with the reason and the words an exam question would use.
1. What is it for?
2. Who uses it at the same time?
3. Operating system
4. Must it survive a stop, terminate or host failure?
Amazon EFS (Regional)
Many Linux instances in several AZs reading and writing the same files: a Regional EFS file system with a mount target in each AZ. Add lifecycle management to IA and Archive for files that go cold.
Exam keywords: shared file system, concurrent access, multiple AZs, Linux, POSIX, WordPress / CMS, home directories
#How to choose
Windows server sharing files?
Shared files for Windows → FSx for Windows File Server. EFS does not support Windows.
Several instances need the same files at the same time?
Yes, Linux → EFS (Regional for production; One Zone for dev/test). If it is HPC on data in S3 → FSx for Lustre.
Can the data be lost when the instance stops or the host fails?
Yes, it is a cache, buffer or scratch space you can rebuild, and you need the highest IOPS → instance store (on an instance type that has it).
Otherwise
One instance, data must persist, boot volume or database → EBS (gp3 by default, io2 for the highest sustained IOPS, st1/sc1 for cheap sequential data). Several instances in one AZ sharing one block device with a cluster-aware application → io2 Multi-Attach.
#Worked exam scenarios
| Scenario | Answer | Why |
|---|---|---|
| A WordPress site runs on an Auto Scaling group across three AZs; uploaded images must be visible on every server | EFS (Regional) | Many Linux instances, several AZs, shared files |
| Fifty Windows application servers need a shared drive that uses the company’s Active Directory | FSx for Windows File Server | Windows, SMB, Active Directory; EFS is Linux only |
| A self-managed database on one instance needs consistent low latency and 40,000 IOPS | EBS io2 (or gp3 if enough) | Block storage for one instance; EFS adds network file system latency |
| A NoSQL cluster keeps three copies of every item and needs the fastest possible local disk | Instance store | Data is replicated by the application; losing one node’s disk is acceptable |
| Cost-optimise a shared document store where most files are not opened after a few weeks | EFS lifecycle to IA (and Archive) | Pay a fraction for cold files, same paths for the application |
| A shared Linux workload has unpredictable bursts of very high throughput, independent of file system size | EFS Elastic throughput | Scales instantly, pay per GB transferred |
| Developers need the cheapest shared Linux file system for a test environment; losing it in an AZ outage is acceptable | EFS One Zone (with One Zone-IA) | About half the price; backups are on by default |
| An HPC job needs a high-performance parallel file system over data stored in S3 | FSx for Lustre | Built for HPC throughput and S3 integration |
| Lambda functions need a shared, persistent directory for large model files | EFS through an access point | Lambda can mount EFS; access points pin the directory and POSIX identity |
| A database instance in us-east-1a fails over to a standby in us-east-1b, and the standby must see the same block volume | Not EBS: replicate at the database level (or use a managed Multi-AZ database) | An EBS volume cannot attach across AZs |
Self-checkQuestion
An e-commerce application runs on Linux EC2 instances in an Auto Scaling group across three Availability Zones. Product images uploaded by staff must be immediately available to every instance, and the storage must stay available if one AZ fails. What should a solutions architect use?
#How EFS is used in system design
- Web fleets behind a load balancer: WordPress, Drupal and other CMS sites put uploads, themes and plugins on EFS so any instance can serve any request and Auto Scaling can add or remove instances freely.
- Shared home directories and development environments for Linux users.
- Containers and serverless: tasks and Lambda functions that come and go need state that outlives them; an access point per application keeps them apart.
- Content and media workflows: several processing servers read and write the same project folders.
- Machine learning: training and inference nodes load the same datasets and models.
Where EFS is the wrong tool:
- Databases with heavy small random writes: every operation crosses the network to a distributed file system, so latency is higher than on EBS. Use EBS (or a managed database).
- Windows: use FSx for Windows File Server.
- Archives and public assets served over HTTP: S3 is far cheaper per GB and scales to any number of clients.
- Scratch space that needs the very lowest latency: instance store.
#Try it yourself
# 1. Security groups: instances (sg-web) and mount targets (sg-efs, inbound NFS from sg-web)
aws ec2 create-security-group --group-name sg-efs --description "EFS mount targets" --vpc-id $VPC
aws ec2 authorize-security-group-ingress --group-id $SG_EFS \
--protocol tcp --port 2049 --source-group $SG_WEB
# 2. A Regional, encrypted file system with Elastic throughput and automatic backups
FS=$(aws efs create-file-system --creation-token shared-web-1 \
--performance-mode generalPurpose --throughput-mode elastic \
--encrypted --backup --tags Key=Name,Value=shared-web \
--query FileSystemId --output text)
aws efs describe-file-systems --file-system-id $FS \
--query "FileSystems[0].[LifeCycleState,ThroughputMode,PerformanceMode,Encrypted]"
# 3. One mount target per AZ (one subnet in each)
for SUBNET in $SUBNET_A $SUBNET_B $SUBNET_C; do
aws efs create-mount-target --file-system-id $FS --subnet-id $SUBNET --security-groups $SG_EFS
done
aws efs describe-mount-targets --file-system-id $FS \
--query "MountTargets[].[AvailabilityZoneName,IpAddress,LifeCycleState]"
# 4. Lifecycle: IA after 30 days, Archive after 90, back to Standard on first access
aws efs put-lifecycle-configuration --file-system-id $FS --lifecycle-policies \
TransitionToIA=AFTER_30_DAYS TransitionToArchive=AFTER_90_DAYS \
TransitionToPrimaryStorageClass=AFTER_1_ACCESS
# 5. An access point for one application: fixed POSIX identity and its own directory
aws efs create-access-point --file-system-id $FS \
--posix-user Uid=1001,Gid=1001 \
--root-directory "Path=/apps/web,CreationInfo={OwnerUid=1001,OwnerGid=1001,Permissions=750}"
# 6. On an instance (Amazon Linux 2023): install the mount helper and mount with TLS
sudo dnf install -y amazon-efs-utils
sudo mkdir -p /mnt/efs
sudo mount -t efs -o tls fs-0abc1234:/ /mnt/efs
df -h /mnt/efs # size shows as 8.0E: there is no fixed size
echo "fs-0abc1234:/ /mnt/efs efs _netdev,tls 0 0" | sudo tee -a /etc/fstab # remount at boot
# Through an access point, with IAM authorisation:
sudo mount -t efs -o tls,iam,accesspoint=fsap-0123456789abcdef0 fs-0abc1234:/ /mnt/web
# 7. Troubleshoot a hanging mount: can the instance reach the mount target on 2049?
nc -zv -w 3 10.0.1.25 2049 # times out → check sg-efs inbound 2049 and the NACLs
#Summary
Key takeaways
- Block storage (EBS, instance store) is a raw disk for one instance; file storage (EFS, FSx) is a shared file system for many; object storage (S3) is whole objects over HTTP.
- EFS is a managed NFSv4.1 file system for Linux. Hundreds or thousands of instances, in every AZ of the Region, mount it at once. It grows and shrinks automatically, and you pay per GB stored.
- Instances reach it through one mount target per AZ. The mount target’s security group must allow inbound TCP 2049 from the instances; otherwise the mount hangs and times out.
- Regional (≥ 3 AZs, recommended) vs One Zone (one AZ, about half the price, no Archive, backups on by default, lost with its AZ).
- Performance mode: General Purpose always; Max I/O is legacy and not allowed with Elastic or One Zone.
- Throughput: Elastic (console default, spiky and unpredictable, pay per GB transferred), Provisioned (set MiB/s, pay for it), Bursting (scales with size, burst credits, API default).
- Storage classes: Standard, IA, Archive (plus One Zone and One Zone-IA). Lifecycle moves files after N days without access (console: IA 30, Archive 90) and, if set, back on first access. IA and Archive have per-GB access charges.
- IA is about 92% cheaper per GB on Bursting/Provisioned file systems and about 95% on Elastic; the real bill saving depends on how much data is truly cold.
- Encryption at rest with KMS is chosen at creation only; in transit uses the mount helper’s TLS option. Access points and IAM control who mounts what. AWS Backup and EFS Replication protect the data.
- Windows → FSx for Windows File Server; HPC → FSx for Lustre; one instance, persistent block → EBS; temporary, fastest → instance store; shared Linux files across AZs → EFS.
Answer on your own first, then read the explanation, even when you got it right.
Self-checkQuestion
Which protocol do EC2 instances use to mount an Amazon EFS file system?
Self-checkQuestion
Which inbound rule must the security group of an EFS mount target have so that web servers can mount the file system?
Self-checkQuestion
Which of these operating systems cannot mount Amazon EFS?
Self-checkQuestion
How is EFS storage billed?
Self-checkQuestion
Which two statements about EFS mount targets are true?
Choose 2
Self-checkQuestion
An engineer creates a new file system in the EFS console with the recommended settings. Which throughput mode does it get?
Self-checkQuestion
Which two statements describe the default lifecycle settings of a file system created in the EFS console?
Choose 2
Self-checkQuestion
Hundreds of Linux EC2 instances spread across three Availability Zones need concurrent read and write access to the same set of files. Which storage service fits best?
Self-checkQuestion
A company runs 40 Windows Server instances that need a shared file system integrated with its Active Directory. What should a solutions architect recommend?
Self-checkQuestion
A company stores contracts on a highly available EFS file system. Most contracts are opened often for two or three weeks after signing and then rarely ever again. How can the company reduce cost the most without reducing availability?
Self-checkQuestion
A shared analytics file system on EFS sees long quiet periods and then unpredictable bursts that need very high throughput, regardless of how much data is stored. Which throughput mode should be used?
Self-checkQuestion
A new instance runs sudo mount -t efs -o tls fs-0abc1234:/ /mnt/efs. The command hangs for a minute and then fails with Connection timed out. The file system has a mount target in the instance’s AZ. What is the most likely cause?
Self-checkQuestion
A team tries to create an EFS file system with the Max I/O performance mode and Elastic throughput, and the request is rejected. What should they do?
Self-checkQuestion
A file system with Bursting throughput holds 100 GiB in Standard. A nightly batch job runs at full speed for about an hour, then slows to a crawl until it finishes. What is happening, and what is the best fix?
Self-checkQuestion
Which two statements about EFS One Zone file systems are true?
Choose 2
Self-checkQuestion
Instances in us-east-1c cannot resolve the file system’s DNS name, while instances in us-east-1a and us-east-1b mount it fine. The file system is Regional. What is the most likely reason and the best fix?
Self-checkQuestion
A Regional file system with Elastic throughput holds 1,000 GB. Only 200 GB is accessed in a typical month; the rest moves to IA. Using $0.30 per GB-month for Standard and $0.016 for IA, what is the monthly storage cost after lifecycle has moved the cold data?
Self-checkQuestion
A Bursting file system holds 2 TiB in the Standard storage class. What baseline write throughput can it sustain continuously?
Self-checkQuestion
A file has been in EFS IA for six months. The file system uses the default Transition into Standard setting of None. A user opens the file. What happens?
Self-checkQuestion
A security audit finds an EFS file system that was created without encryption at rest. The company must encrypt it. What should a solutions architect do?
Self-checkQuestion
How do you make sure that all data between EC2 instances and an EFS file system is encrypted in transit?
Self-checkQuestion
Three applications share one EFS file system. Each must see only its own directory and must always act as its own POSIX user, whatever user the client runs as. What is the simplest way to enforce this?
Self-checkQuestion
Lambda functions need to load 3 GB machine learning models that are shared by many functions and updated weekly. The models must persist between invocations. Which storage fits best?
Self-checkQuestion
A company needs a copy of its production EFS file system in another Region for disaster recovery, kept up to date automatically with a recovery point of minutes. What should it use?
Self-checkQuestion
Which two statements correctly compare EFS with EBS?
Choose 2
Self-checkQuestion
Which two workloads are a good fit for Amazon EFS?
Choose 2
Self-checkQuestion
Which statement about instance store, EBS and EFS is NOT true?
Self-checkQuestion
A team plans to move the data files of its self-managed PostgreSQL database, which runs on one instance and does many small random writes, onto EFS so that the data is safer. What is the best advice?
Self-checkQuestion
Study notes say: ‘EFS-IA costs about 92% less than regular EFS.’ What is the most accurate statement today?
Self-checkQuestion
Study notes list the EFS throughput modes and mark Bursting as the default. What is the accurate version?