EBS, EFS, FSx and Instance Store Compared: Block, File and Object Storage on AWS
Three Kinds of Storage
| Kind | Like... | Access | AWS services |
|---|---|---|---|
| Block | A hard disk inside a computer | Mounted by one server, formatted with a file system | EBS, instance store |
| File | A shared network folder | Many servers mount the same folder (NFS or SMB) | EFS, FSx |
| Object | A giant online drive with web links | Via API/HTTP, each file is an object | S3, Glacier |
Amazon EBS (Elastic Block Store)
- Network-attached disks for EC2, in one AZ, replicated inside that AZ
- Persist after the instance stops. Detach and attach to another instance in the same AZ
- Types: gp3 (default), io2 (high IOPS), st1/sc1 (HDD)
- Snapshots back up volumes to S3 and can be copied across Regions
- You can resize online and encrypt volumes
- Normally attached to one instance (Multi-Attach for special io1/io2 cases)
Instance Store
- Disk physically inside the host server. Very fast, but data is lost when the instance stops or fails
- Use for temporary data: caches, buffers, scratch space
Amazon EFS (Elastic File System)
- A shared file system for Linux using NFS. Many EC2 instances, containers and Lambda functions can mount the same files at once, across AZs
- Elastic: grows and shrinks automatically, pay for what you use
- Storage classes with lifecycle management (Standard, Infrequent Access, Archive)
- Encrypted at rest and in transit. Needs port 2049 open in the security group of the mount target
- Typical uses: web content shared by servers, home directories, content management systems, machine learning data
bash
# On an EC2 Linux server
sudo dnf install -y amazon-efs-utils
sudo mkdir /mnt/efs
sudo mount -t efs -o tls fs-0123456789abcdef0:/ /mnt/efs
echo "shared file" | sudo tee /mnt/efs/note.txt
df -h /mnt/efs
# Persist across reboots: add to /etc/fstab
# fs-0123456789abcdef0:/ /mnt/efs efs _netdev,tls 0 0
Amazon FSx: Managed File Systems for Special Needs
| FSx type | Use |
|---|---|
| FSx for Windows File Server | Windows shared folders (SMB) with Active Directory |
| FSx for Lustre | High-speed file system for HPC and machine learning, linked to S3 |
| FSx for NetApp ONTAP | Multi-protocol file storage (NFS, SMB, iSCSI) with NetApp features |
| FSx for OpenZFS | Fast Linux file storage with snapshots and cloning |
Comparison Table
| EBS | Instance store | EFS | S3 | |
|---|---|---|---|---|
| Type | Block | Block | File (NFS) | Object |
| Shared by many servers | No (one instance) | No | Yes | Yes (over API) |
| Scope | One AZ | One host | Multi-AZ Region | Regional, multi-AZ |
| Survives stop | Yes | No | Yes | Yes |
| Capacity | Up to 64 TiB per volume | Fixed by instance | Elastic (petabytes) | Virtually unlimited |
| Best for | Boot disks, databases | Temporary cache | Shared files for Linux | Backups, media, data lakes, websites |
Decision Guide
| Need | Pick |
|---|---|
| Disk for an EC2 server or database | EBS |
| Scratch space, fastest local I/O | Instance store |
| Shared folder for many Linux servers | EFS |
| Shared Windows folder | FSx for Windows |
| Store images, videos, backups, static websites | S3 |
| Very cheap long-term archive | S3 Glacier |
Practice
- Create an EFS file system and mount it on two instances. Write a file on one and read on the other
- Create an EBS volume, attach it, write data, stop the instance and confirm the data stays
- Explain why a database on instance store is risky
- Fill in the comparison table without looking
Conclusion
Use EBS for server disks, instance store for temporary data, EFS or FSx for shared files, and S3 for objects, backups and websites. Know scope (AZ vs Region), sharing and persistence differences.
Quick Summary: three kinds; EBS; instance store; EFS; FSx; comparison; decision guide.

