If you accidentally delete a virtual server's data, you could lose a critical customer database forever. That is why you must understand how to manage storage in the cloud. For the SOA-C02 exam, you need to know how to attach, resize, snapshot, and share Amazon EBS volumes, and how to configure and mount Amazon EFS file systems.
Jump to a section
27 flats in a single apartment block each need a place to keep their belongings. One flat (a database server) has 4 heavy suitcases (its data), while another (a web server) has 10 small boxes (its logs). In the old way, each flat got one fixed-size cupboard built into the wall. If the flat with 4 suitcases only got a cupboard for 3, they had to ask the landlord to break down the wall and install a bigger cupboard—a process that took hours and meant the flat was unusable during the change. Worse, the flat with 10 small boxes got a massive cupboard they never filled, paying rent for empty space. Then the landlord introduced two new systems. First, each flat got a 'magic cupboard' that could shrink or grow instantly, only charging for the space actually used. That is Amazon EBS: a virtual disk you attach to one flat (one virtual machine) that can change size on demand without downtime. Second, the landlord installed a shared storage room in the basement that every flat could access at the same time through a hall door. 10 flats could all drop their boxes in there simultaneously. That is Amazon EFS: a file system many machines mount at once. The magic cupboard keeps each flat's stuff separate. The basement room lets everyone share.
Notice a key difference: the magic cupboard is only for the flat that rented it—no other flat can open it. The basement room is designed for multiple flats to read and write the same box at the same time, though there are rules to avoid two flats grabbing the same box at once (file locking). In AWS terms, that is the difference between block storage (EBS) and file storage (EFS). Block storage behaves like a hard drive directly wired to one computer. File storage behaves like a network drive that many computers can access together.
Amazon Web Services (AWS) offers two main types of storage for virtual machines (EC2 instances): EBS and EFS. Let us break down exactly what these are, why they exist, and how you use them.
Amazon Elastic Block Store (EBS) is a high-performance, persistent block storage volume you attach to a single EC2 instance. Think of it as a virtual hard drive. You create an EBS volume, attach it to a virtual server, format it with a file system (like ext4 or XFS), and then you can store files on it. The key characteristic is that it is attached to one instance at a time. You can detach it and reattach it to another instance, but while it is attached, only that instance can read or write to it. EBS volumes come in different types: General Purpose SSD (gp2/gp3) for most workloads, Provisioned IOPS SSD (io1/io2) for high-performance databases, Throughput Optimised HDD (st1) for big data and log processing, and Cold HDD (sc1) for rarely accessed data. Each type is optimised for different price and performance needs. You can take snapshots (point-in-time backups) of EBS volumes and store them in Amazon S3. Snapshots are incremental: the first snapshot copies the entire volume, but subsequent snapshots only copy changed blocks. This saves storage costs.
Amazon Elastic File System (EFS) is a fully managed, scalable file storage system that you can mount on many EC2 instances simultaneously using the NFS protocol. It is like a network drive that multiple servers access at the same time. EFS is designed for shared workloads like content management systems, web serving, or big data analytics where multiple instances need to read and write the same files. EFS automatically grows and shrinks as you add and remove files—you do not need to provision capacity in advance. You are billed only for the storage you actually use. EFS has two storage classes: Standard (for frequently accessed data) and Infrequent Access (IA) (for data accessed less than once a quarter). You can also enable Lifecycle Management to automatically move files from Standard to IA after a set number of days without access.
Why do both exist? The answer is about access patterns. EBS gives you fast, dedicated access to a single block device—perfect for databases, boot volumes, or applications that need low-latency, consistent performance. EFS gives you shared access across many instances—perfect for web server farms, shared configuration files, or collaborative editing. You cannot use EBS for shared access; if you try to attach the same EBS volume to two instances, it will corrupt the data. You cannot use EFS for a high-performance database that requires very low latency; NFS overhead adds slight delay.
What did they replace? Before cloud, you bought physical hard drives. You had to guess how much storage you would need for years. You had to physically install drives in servers. You had to manage backup tapes. EBS and EFS replace all that with elastic, programmable, pay-as-you-go storage.
To manage EBS efficiently, you must understand:
How to create volumes from the AWS Management Console, CLI, or SDK.
How to attach and mount them to EC2 instances.
How to resize volumes without downtime.
How to create snapshots for backup and restore.
How to encrypt volumes using AWS Key Management Service (KMS).
How to enable delete-on-termination for boot volumes.
To manage EFS efficiently, you must understand:
How to create a file system and configure a mount target in each Availability Zone.
How to mount it on EC2 instances using the NFS client.
How to set up security groups to allow traffic on port 2049 (NFS).
How to configure lifecycle policies to move data to IA.
How to enable encryption at rest (using KMS) and in transit (using TLS).
How to use EFS access points to enforce user/group permissions.
The exam loves to test the differences between EBS and EFS. They will give you a scenario—'You have a web application running on 10 EC2 instances that all need to read the same configuration file. Which storage option?' The answer is EFS. They will ask about snapshot behaviour—'Which is true about EBS snapshots?' Answer: Snapshots are incremental after the first full copy. They will test which EBS volume type to use for a high-transaction database: Provisioned IOPS SSD (io1/io2). They will test when to use EBS versus instance store (ephemeral storage): instance store loses data on stop/terminate; EBS persists.
Remember: EBS = block storage, single-instance, persistent, backup via snapshots. EFS = file storage, multi-instance, managed, scalable. Both are essential building blocks for any AWS solution.
Create an EBS Volume
In the AWS Console, go to EC2 > Elastic Block Store > Volumes. Click 'Create Volume'. Choose the volume type (e.g., gp3), size (e.g., 100 GiB), and Availability Zone (must match the instance's AZ for attachment). Optionally, enable encryption with a KMS key. This step allocates the storage resources for your virtual hard drive.
Attach the EBS Volume to an EC2 Instance
Select the volume, click 'Actions > Attach Volume'. Choose the target instance from the drop-down list. Specify the device name (e.g., /dev/sdf). Once attached, the instance sees a new raw block device. You cannot attach it to more than one instance at a time (unless using multi-attach).
Mount the Volume on the Instance's Operating System
SSH into the instance. If the volume is new, you must create a file system: 'sudo mkfs -t ext4 /dev/xvdf'. Then create a mount point directory: 'sudo mkdir /data'. Mount it: 'sudo mount /dev/xvdf /data'. Add an entry to /etc/fstab to auto-mount on reboot. This step makes the storage accessible to applications.
Take an EBS Snapshot for Backup
In the Console, select the volume, go to 'Actions > Create Snapshot'. Provide a name and description. The snapshot goes to S3. For consistent backups, freeze the file system with 'sudo xfs_freeze -f /data' (if using XFS) before starting. The snapshot is incremental after the first full copy.
Create an EFS File System
Go to EFS Console, click 'Create File System'. Choose a name (e.g., 'shared-documents'). Select the VPC and add mount targets in each Availability Zone where you have instances (choose subnets). Configure security groups to allow inbound NFS. This step sets up the shared network storage.
Mount the EFS File System on Multiple EC2 Instances
On each EC2 instance, install the NFS client (e.g., 'sudo yum install -y amazon-efs-utils'). Create a mount point (e.g., 'sudo mkdir /efs'). Mount using the DNS name: 'sudo mount -t nfs4 -o nfsvers=4.1,hard,timeo=600,retrans=2 fs-12345678.efs.us-east-1.amazonaws.com:/ /efs'. Add to /etc/fstab. Now all instances can read and write the same files.
Imagine you are the new cloud engineer at a medium-sized online retailer. The company migrated its applications to AWS six months ago, but storage management is a mess. You walk into your first incident review.
The company runs a customer-facing e-commerce site. The database team manages a MySQL database on an EC2 instance with a 500 GB General Purpose SSD (gp2) EBS volume. The web team runs 25 EC2 instances behind a load balancer, all serving the same PHP application. The application's images and CSS files are stored on each instance's local disk. When a new set of promotional images is uploaded to one instance, the other 24 do not see them. The site serves inconsistent content. The marketing team is furious.
The root cause: the web servers are not sharing storage. They should use EFS. Here is what you do step by step.
First, you create an Amazon EFS file system. You open the AWS Management Console, navigate to EFS, and click 'Create file system'. You give it a name like 'shared-web-assets'. You select your VPC (Virtual Private Cloud) and choose the Availability Zones where your web instances run. For each AZ, you create a mount target—this is the network endpoint that instances connect to. You configure the security group for the mount targets to allow inbound NFS traffic (port 2049) from the security group of your web servers.
Next, you update your web server configuration. On each of the 25 instances, you install the NFS client (amazon-efs-utils on Amazon Linux). You create a mount point directory (e.g., /var/www/html/images). Then you mount the EFS file system using the command 'sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 fs-12345678.efs.us-east-1.amazonaws.com:/ /var/www/html/images'. You add the entry to /etc/fstab so the mount persists across reboots. Now, when marketing uploads new promotional images to one instance, those images are written to the EFS file system. All 25 instances read from the same file system immediately. The inconsistency is gone.
Meanwhile, the database administrator is worried about the MySQL volume. It is a 500 GB gp2 volume that is 90% full. The database is running out of space. You need to resize it without any downtime. Here is how you do it:
You take a snapshot of the volume first, just in case. Navigate to EC2 > Elastic Block Store > Volumes, select the volume, and choose 'Actions > Create snapshot'. You give it a description like 'pre-resize-snapshot-mysql-20250101'. While the snapshot is being created (it happens in the background), you modify the volume. You select the volume, click 'Actions > Modify Volume', and change the size from 500 to 750 GB. You confirm the change. Within a few minutes, the volume expands. On the EC2 instance, you extend the file system. For a Linux ext4 file system, you run 'sudo growpart /dev/xvda 1' and 'sudo resize2fs /dev/xvda1'. The database sees more space without any restart. The database admin is relieved.
You also implement a snapshot lifecycle policy: automatic weekly snapshots retained for 4 weeks, with daily snapshots retained for 7 days. This ensures the company can restore the database to any point in the last week.
Later, you migrate the database to a Provisioned IOPS volume (io2) to guarantee consistent 10,000 IOPS during peak shopping periods. You create a new io2 volume, attach it to a new EC2 instance, restore the latest snapshot onto it, and then switch the database server. Cost increases slightly, but the database performance becomes predictable.
Finally, you clean up: you identify 20 orphaned EBS volumes (volumes not attached to any instance) that were left over from terminated instances. Each is charging the company $10/month for no reason. You delete them. The monthly bill drops by $200.
In this real-world scenario, you used EBS for the database (dedicated, high-performance, resizable) and EFS for shared web assets (multi-instance access, auto-scaling). You used snapshots for backup and volume modification for resizing. You used volume types correctly: gp2 for general use, io2 for performance-critical workloads. You also learned the importance of cleaning up unused resources to save cost.
The SOA-C02 exam tests your understanding of EBS and EFS in multiple ways. Here is exactly what you need to know.
First, you must memorise the six EBS volume types and their primary use cases. The exam will present a scenario and ask you to choose the correct volume type. Common scenarios:
A database requiring 20,000 IOPS with low latency: choose Provisioned IOPS SSD (io1/io2).
A boot volume for a general-purpose EC2 instance: choose General Purpose SSD (gp2 or gp3).
A data warehouse that processes large log files with high throughput: choose Throughput Optimised HDD (st1).
Rarely accessed archival data: choose Cold HDD (sc1).
Trap: The exam might list 'Magnetic (standard)' as an answer. This is the old generation volume type. It is still valid but rarely used. The exam expects you to choose the modern type (gp3, io2) for most scenarios.
Second, you must understand EBS snapshots thoroughly. Key facts tested:
Snapshots are stored in Amazon S3 (though you do not see them in the S3 console).
The first snapshot is a full copy. Subsequent snapshots are incremental (only changed blocks).
You can share snapshots with other AWS accounts or make them public.
You can copy snapshots across regions for disaster recovery.
When you restore a snapshot to a new volume, it takes time to hydrate (fetch data from S3). You can use the 'fast snapshot restore' feature to get instant initialisation.
You can create snapshots of volumes that are still attached (live snapshots), but you might want to freeze the file system first to ensure consistency (e.g., using xfs_freeze for XFS file systems).
Trap: Do not confuse snapshots with AMIs (Amazon Machine Images). A snapshot backs up a volume; an AMI includes one or more snapshots plus metadata (launch permissions, block device mapping). The exam will ask: 'You want to create a custom AMI from a running instance.' The answer involves creating a snapshot first, then registering an AMI from that snapshot.
Third, you must know EFS basics:
EFS is a regional service (it spans all Availability Zones in a Region). You create mount targets in each AZ where your instances live.
EFS uses NFSv4.1 protocol. Security groups must allow inbound NFS (port 2049).
EFS can be accessed from on-premises via AWS Direct Connect or VPN.
EFS has lifecycle policies: automatically move files to EFS Infrequent Access (IA) storage class after X days (30, 60, 90 days).
EFS supports encryption at rest (using KMS) and in transit (using TLS). You must enable these when creating the file system.
Trap: The exam might ask about EFS performance modes. There are two: General Purpose (for latency-sensitive use cases like web serving) and Max I/O (for high-throughput, parallel workloads like big data). General Purpose is the default. Max I/O has lower latency consistency but scales to higher throughput. If a scenario mentions hundreds or thousands of clients accessing the same file system, Max I/O is correct.
Fourth, the exam tests the difference between EBS and instance store (ephemeral storage). Instance stores are temporary disks physically attached to the host computer. Data is lost when the instance stops or terminates. EBS persists. Instance stores are used for cache or scratch data. The exam will ask: 'Which storage should you use for temporary data that can be regenerated?' Answer: instance store.
Fifth, you need to know how to attach and detach EBS volumes. The exam tests that:
You can attach a volume to one instance at a time (except for certain multi-attach enabled io1/io2 volumes, but that is an advanced feature).
You can detach a volume from a running instance (but you might want to unmount it first to avoid corruption).
You can change the volume type or size without detaching (modification).
Trap: The exam might say 'You want to attach an encrypted volume to an unencrypted instance.' Answer: You can, because the encryption happens at the EBS level, not the instance. The instance does not need to be encrypted.
Sixth, understand EFS file system policy and access points. Access points apply a specific POSIX user and group to every NFS request made through that access point. This is useful for enforcing permissions for different applications sharing the same file system.
Finally, the exam will test cost optimisation: using EFS IA for infrequently accessed files, using GP3 for most EBS volumes (it is cheaper than GP2 at the same performance), deleting orphaned EBS volumes, and choosing the right volume type for the workload.
Memorise these exact patterns and you will answer storage questions correctly.
EBS is block storage attached to a single EC2 instance, providing persistent, high-performance storage for boot volumes and databases.
EFS is file storage that can be mounted on many EC2 instances simultaneously using NFS, ideal for shared content or application data.
EBS snapshots are stored in S3 and are incremental after the first full snapshot, saving storage costs on backups.
EBS volume types are optimised for different workloads: gp2/gp3 for general use, io1/io2 for high IOPS, st1 for throughput, and sc1 for cold data.
EFS automatically scales its storage capacity, and you pay only for what you use, with lifecycle policies to move old files to Infrequent Access.
Instance store volumes are ephemeral and lose data on instance stop or termination, making them suitable only for cache or temporary data.
You can resize EBS volumes and change their type without detaching them, minimising downtime during storage changes.
EFS mount targets must be in the same VPC and subnets as the EC2 instances, with security groups allowing NFS traffic on port 2049.
These come up on the exam all the time. Here's how to tell them apart.
Amazon EBS (Elastic Block Store)
Provides block-level storage that behaves like a hard drive attached to one instance
Can only be attached to one EC2 instance at a time (except multi-attach io1/io2)
You specify the storage capacity (size in GiB) and pay for the provisioned capacity
Amazon EFS (Elastic File System)
Provides file-level storage that can be accessed by many instances via NFS
Supports simultaneous mounting by hundreds or thousands of EC2 instances
You pay only for the storage you use; it is elastic and auto-scales
EBS Snapshot (Backup)
A point-in-time backup of a single EBS volume
Stored in Amazon S3, not directly visible in the S3 console
Can be used to create a new volume in the same or different AZ/Region
AMI (Amazon Machine Image)
A complete image of an EC2 instance, including one or more snapshots and launch permissions
Used to launch new instances with the same operating system, software, and configuration
Includes block device mapping (which volumes are attached to which device names)
General Purpose SSD (gp2/gp3)
Baseline performance of 3 IOPS per GiB (gp2) or 3,000 IOPS fixed (gp3)
Suitable for most workloads: boot volumes, dev/test, small databases
Lower cost per GiB compared to io1/io2
Provisioned IOPS SSD (io1/io2)
Provides consistent, guaranteed IOPS (up to 256,000 for io2 Block Express)
Designed for latency-sensitive, high-performance databases (e.g., Oracle, SQL Server, SAP)
Higher cost per GiB but essential for critical production workloads
EFS Standard Storage Class
For frequently accessed data (accessed at least once a month)
Lower cost per GB-month for data retrieval (no retrieval fee)
Higher storage cost per GB-month compared to IA
EFS Infrequent Access Storage Class (IA)
For data accessed less than once a quarter (e.g., old logs, archives)
Lower storage cost per GB-month (approx. 50% cheaper)
Higher cost per GB read/written (a retrieval fee applies)
EBS Delete-on-Termination Flag
When set to 'true', the volume is automatically deleted when the EC2 instance is terminated
Typically enabled for root (boot) volumes to clean up when the instance is terminated
Reduces orphaned volumes and associated costs
EBS Keep-on-Termination (default for non-root volumes)
When set to 'false', the volume remains in your account after instance termination
Typically used for data volumes that must persist even after the instance is gone
Requires manual deletion; you might incur costs for unused volumes
EFS General Purpose Performance Mode
Optimised for low latency for most file operations (e.g., web serving, content management)
Suitable for up to hundreds of NFS clients simultaneously
Provides consistent sub-millisecond latency for most requests
EFS Max I/O Performance Mode
Optimised for high throughput and high concurrency (thousands of clients, big data analytics)
Scales to higher levels of throughput (up to 10+ GB/s per file system)
May have slightly higher and more variable latency compared to General Purpose
Mistake
EBS snapshots are stored on the same EBS volume, so you need to keep the original volume to restore from snapshots.
Correct
EBS snapshots are stored in Amazon S3, separate from the volume. You can delete the original volume and still restore from the snapshot at any time.
New users often think snapshot is like a local backup on the same disk; they do not realise it is a separate, independent copy in a different service.
Mistake
You can attach the same EBS volume to multiple EC2 instances at the same time to share data.
Correct
Standard EBS volumes can only be attached to one instance at a time. Multi-attach is only available for specific io1/io2 volumes and requires clustered file systems.
The word 'block storage' sounds like a shared network drive, but in practice, block devices are designed for single-writer access to prevent data corruption.
Mistake
EFS requires you to provision storage capacity upfront and you pay for the maximum capacity you set.
Correct
EFS is elastic. You do not provision capacity. You pay only for the storage you actually use, and it automatically scales up and down.
Many people expect file systems to have fixed sizes like local disks. They do not realise EFS manages growth automatically.
Mistake
If you stop an EC2 instance, the data on an instance store volume is preserved.
Correct
Instance store volumes lose data when the instance is stopped, hibernated, or terminated. They are ephemeral.
Beginners confuse instance store with EBS. Instance store is physically on the host and is not persistent across stop/start cycles.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
No. EFS adds network latency because it uses NFS over the network. For databases requiring low latency and high IOPS, use EBS volumes (like io2) attached directly to the instance.
Modify the volume in the AWS Console (increase size) without detaching. Then use OS commands to extend the file system (e.g., resize2fs for ext4). This can be done without downtime.
Yes. You can modify the snapshot permissions to share it with specific AWS account IDs or make it public. The other account can then restore a volume from that snapshot.
The data on the instance store volume is lost because it is physically attached to the host machine. Instance store is ephemeral. EBS volumes persist data when the instance stops.
No. EFS does not include built-in automatic backup. You must use AWS Backup service or write custom scripts to take snapshots or replicate data. You can enable EFS Replication for cross-Region disaster recovery.
No. An EBS volume must be in the same Availability Zone as the instance to which you attach it. You can copy a snapshot to another AZ and then create a volume from it.
You've just covered EFS and EBS Storage Management — now see how well it sticks with free SOA-C02 practice questions. Full explanations included, no account needed.
Done with this chapter?