π Day 17 | AWS EFS (Elastic File System) β Shared Storage in AWS ποΈβοΈ
Today, I learned about Amazon EFS (Elastic File System), which is a fully managed, scalable, shared file system in AWS.
EFS allows multiple EC2 instances to read and write data simultaneously, making it ideal for DevOps and cloud-native architectures.
EFS helps in building highly available, scalable, and persistent storage solutions for applications running across multiple Availability Zones.
ποΈ AWS EFS (DevOps β Shared File System)
πΉ Amazon EFS (Elastic File System)
Service Type
- File-based storage service
- Uses NFS protocol (Port 2049)
Key Features
- Shared storage across multiple EC2 instances
- Automatically scales storage
- Highly available (Multi-AZ)
- Fully managed by AWS
- Linux-based file system
Common DevOps Use Cases
- Jenkins shared workspace
- Kubernetes Persistent Volumes (PV/PVC)
- Web application shared uploads
- Centralized logs storage
- WordPress media storage
One-Line Summary (Interview)
Amazon EFS is a fully managed shared file system that provides scalable and highly available storage for multiple EC2 instances across availability zones using NFS.
AWS EFS (Elastic File System) β Step by Step DevOps Guide
This guide explains Amazon EFS in a simple, fresher-friendly DevOps way, ready to upload on GitHub (Markdown format).
1οΈβ£ What is AWS EFS?
Amazon EFS (Elastic File System) is a fully managed, scalable, shared file system provided by AWS.
π Think of EFS like Google Drive for EC2 instances β multiple EC2 instances can read and write the same data at the same time.
2οΈβ£ Why We Use EFS in DevOps
EFS is used when we need:
- β Shared storage between multiple EC2 instances
- β Persistent data (data survives EC2 termination)
- β High availability (multi-AZ)
- β Linux-based file system (NFS)
3οΈβ£ Real-World DevOps Use Cases
| Use Case | Why EFS |
|---|---|
| Web application uploads | Same files for all EC2 |
| Jenkins shared workspace | Multiple Jenkins agents |
| Kubernetes persistent storage | Shared PVC |
| Centralized logs | Common log directory |
| WordPress media | Shared media files |
4οΈβ£ How EFS Works (Architecture)
User
β
Load Balancer
β
EC2 (AZ-1) ββ
EC2 (AZ-2) ββΌββ> EFS (Shared File System)
EC2 (AZ-3) ββ
- EFS is regional
- Uses NFS protocol (Port 2049)
- Mounted like a folder inside EC2
5οΈβ£ EBS vs EFS vs S3 (Interview Comparison)
| Feature | EBS | EFS | S3 |
|---|---|---|---|
| Storage Type | Block | File | Object |
| Attach | Single EC2 | Multiple EC2 | Internet |
| OS Support | Linux/Windows | Linux only | Any |
| Mountable | Yes | Yes | No |
| Shared Access | β | β | β |
6οΈβ£ Step-by-Step: How to Create and Use EFS
πΉ Step 1: Create EFS
- AWS Console β EFS
- Click Create file system
- Select VPC
- Availability Zones β Auto selected
- Click Create
πΉ Step 2: Configure Security Group
EFS needs NFS access.
Inbound Rule:
Type: NFS
Port: 2049
Source: EC2 Security Group
πΉ Step 3: Launch EC2 Instance
- Amazon Linux 2
- Same VPC as EFS
- Attach same Security Group
- SSH into the instance
πΉ Step 4: Install EFS Utilities
sudo yum install -y amazon-efs-utils
πΉ Step 5: Create Mount Directory
sudo mkdir /efs
πΉ Step 6: Mount EFS to EC2
sudo mount -t efs fs-xxxx:/ /efs
Check mount:
df -h
πΉ Step 7: Test Shared Storage
cd /efs
sudo touch devops.txt
Mount the same EFS on another EC2 β file will be visible β
7οΈβ£ Auto-Mount EFS on Reboot (Important)
Edit fstab file:
sudo nano /etc/fstab
Add entry:
fs-xxxx:/ /efs efs defaults,_netdev 0 0
8οΈβ£ EFS Performance Modes
| Mode | Usage |
|---|---|
| General Purpose | Web apps, CMS |
| Max I/O | Big data, analytics |
9οΈβ£ EFS Storage Classes
| Class | Cost |
|---|---|
| Standard | Normal access |
| Infrequent Access (IA) | Lower cost |
| One Zone | Cheapest (single AZ) |
π EFS Usage in DevOps Tools
| Tool | Usage |
|---|---|
| Jenkins | Shared workspace |
| Docker | Shared volume |
| Kubernetes | Persistent Volumes |
| Terraform | Infrastructure creation |
| Ansible | Auto mount configuration |
1οΈβ£1οΈβ£ Common Interview Questions
Q1: Can EFS be mounted on multiple EC2 instances?
β Yes, simultaneously.
Q2: Is EFS AZ-specific?
β No, it is regional.
Q3: Which protocol does EFS use?
β NFS (Port 2049).
Q4: Can Windows use EFS?
β No, only Linux supports EFS.
1οΈβ£2οΈβ£ One-Line Interview Answer
Amazon EFS is a fully managed, scalable, shared file system that allows multiple EC2 instances across availability zones to access the same data using NFS.
Thank You
π Connect With Me
| π Platform | π Link |
|---|---|
| π GitHub | https://lnkd.in/d2F3JPa3 |
| βοΈ Dev.to Blog | https://lnkd.in/dNtgqAME |
| πΌ LinkedIn | https://lnkd.in/d3NctxFT |
| π Resume (Google Drive) | https://lnkd.in/dHDNsd_D |
π Hashtags
AWS #DevOps #CloudComputing #AWSLearning #EBS #VolumeMounting #DataPersistence #LearningJourney #CareerGrowth #DevOpsEngineer #AWSCommunity
β If you like this guide, donβt forget to star the repo!
Top comments (0)