# EBS

> Source: Courseiva IT Certification Glossary — https://courseiva.com/glossary/ebs

## Quick definition

Amazon EBS is like a virtual hard drive in the cloud that you can attach to a virtual computer (EC2 instance). It keeps your data safe even when the computer is turned off. You can choose how big it is and how fast it performs. It is used for databases, file systems, and any application that needs reliable storage.

## Simple meaning

Imagine you have a laptop at home. The internal hard drive inside it stores all your files, photos, and applications. If you turn off the laptop, your data stays on the hard drive. When you turn it back on, everything is still there. Amazon EBS works exactly like that hard drive, but for virtual computers in Amazon's cloud. These virtual computers are called EC2 instances. 

 You decide how much storage space you need, just like choosing between a 256GB or 1TB hard drive for your laptop. EBS also lets you pick the speed of the drive. Some applications, like a video editing program, need very fast drives, so you would choose a high-performance EBS volume. Other applications, like a simple file server, can work with a slower, cheaper volume. 

 The best part is flexibility. If your laptop hard drive gets full, you have to buy a new laptop or an external drive. With EBS, you can increase the size of your virtual hard drive with a few clicks, without shutting anything down. You can also take a snapshot of your volume at any time, which is like taking a perfect photograph of everything on it. If something goes wrong later, you can restore from that snapshot. EBS is the foundation for almost all data storage on AWS when you need persistent, reliable storage for your applications.

## Technical definition

Amazon Elastic Block Store (EBS) is a block-level storage service designed for use with Amazon EC2 instances. It provides raw, unformatted block devices that can be attached to an EC2 instance, formatted with a file system (such as ext4, XFS, or NTFS), and used like a physical hard drive. EBS volumes are replicated within an Availability Zone (AZ) to protect against component failure, offering high availability and durability. 

 EBS volumes can be classified into several types based on performance characteristics and use cases. General Purpose SSD (gp3 and gp2) balances price and performance for most workloads. Provisioned IOPS SSD (io2 and io1) is designed for latency-sensitive transactional workloads like databases, offering consistent IOPS performance. Throughput Optimized HDD (st1) is for frequently accessed, throughput-intensive workloads like big data and log processing. Cold HDD (sc1) is for less frequently accessed workloads with lower cost. Magnetic (standard) is a previous generation type now rarely used. 

 Each EBS volume exists in a specific Availability Zone and can only be attached to an EC2 instance in the same AZ. However, you can create snapshots of EBS volumes and restore them to other AZs or regions. EBS snapshots are stored in Amazon S3 and are incremental, meaning only changed blocks are saved after the first snapshot, saving storage costs. 

 EBS also supports encryption at rest using AWS KMS, and data in transit between EC2 and EBS is encrypted. Volume types can be modified without downtime in most cases, allowing for live resizing or performance tuning. The service integrates with AWS Backup, CloudWatch, and CloudTrail for monitoring, backup, and auditing. In real IT implementations, EBS is the backbone for relational databases like MySQL, PostgreSQL, and Oracle, as well as for NoSQL databases, data warehouses, and any application requiring persistent block storage.

## Real-life example

Think of Amazon EBS like a high-quality external hard drive that you keep in your office. You plug this drive into your desktop computer when you need to work on large projects. The drive holds all your work files, software installers, and backups. When you unplug the computer from power or shut it down for the night, the drive keeps everything saved. The next morning, you plug it back in and continue exactly where you left off. 

 Now imagine that your desktop computer is actually a virtual computer running in a data center far away. You don't physically plug the drive in; you attach it through a web console or API. That is what EBS does for EC2 instances. You create a virtual hard drive (the EBS volume) and attach it to your virtual computer. 

 If you need more space, you don't go to a store to buy a bigger drive. You just increase the size of your EBS volume online, and within minutes, your virtual computer sees the extra space. You can also duplicate your drive by creating a snapshot. This is like taking a complete, perfect copy of everything on the external hard drive. If your drive ever fails or you accidentally delete an important file, you can restore from that snapshot and get everything back. EBS is built to be reliable and safe, exactly like a high-quality external drive, but much more powerful and flexible because it lives in the cloud.

## Why it matters

EBS matters because it is the primary persistent storage for EC2 instances, which are the core compute resources in AWS. Without EBS, EC2 instances would be like computers without hard drives-they could run but would lose everything when powered off. For any serious application, whether it is a web server, a database, or an enterprise application, you need storage that persists independently of the compute instance. 

 In practical IT contexts, EBS enables critical capabilities. For example, you can launch an EC2 instance, attach a large EBS volume, and run a database like MySQL. If the EC2 instance fails, you can launch a new instance and attach the same EBS volume, recovering your database quickly. This decoupling of storage from compute is a fundamental cloud architecture pattern. 

 EBS also supports advanced features like point-in-time snapshots, encryption, and performance tuning. IT professionals can provision exactly the right balance of IOPS, throughput, and capacity for each workload, optimizing both cost and performance. EBS volumes can be resized, have their type changed, and even have their performance increased without downtime, which is crucial for production systems. 

EBS is the foundation for many AWS services like RDS (Relational Database Service) and Redshift, which internally use EBS for their underlying storage. Understanding EBS is essential for designing resilient, scalable, and cost-effective cloud architectures. It directly impacts system availability, backup strategies, disaster recovery, and compliance requirements.

## Why it matters in exams

EBS is a primary topic in both the AWS Cloud Practitioner and AWS Solutions Architect Associate exams. For the Cloud Practitioner exam, you should understand the basic concepts: what EBS is, that it provides block storage for EC2, that volumes are tied to an Availability Zone, and that snapshots are stored in S3. Expect questions about choosing the right volume type for a given scenario, such as why you would use Provisioned IOPS SSD for a database versus Throughput Optimized HDD for log processing. 

 For the AWS Solutions Architect Associate exam (SAA-C03), EBS appears in depth. You must know every volume type and its performance characteristics (IOPS, throughput, max volume size). You should understand the differences between gp2 and gp3, between io1 and io2, and when to use st1 versus sc1. Exam questions often test your understanding of snapshot lifecycle, encryption at rest using KMS, and multi-attach capabilities for io2 volumes. 

 Architects need to know how to design for high availability using EBS snapshots across regions, how to create AMIs from EBS-backed instances, and how to use EBS-optimized instances for maximum performance. Expect scenario-based questions where you must choose the most cost-effective and performant storage solution for a given workload. For example, you may be asked to design a storage solution for a high-traffic e-commerce database that requires consistent low latency. The correct answer would involve io2 volumes with adequate IOPS and an EBS-optimized instance. 

 Also, be prepared for questions about data lifecycle management: how to automate snapshots, how to delete old snapshots, and how to restore a volume from a snapshot in a different Availability Zone. Encryption is a common exam trap, so know that you can enable encryption on unencrypted volumes only by creating a snapshot of the volume, copying the snapshot with encryption, and then creating a new encrypted volume from that copy.

## How it appears in exam questions

EBS appears in exam questions in several common patterns. 

 Scenario-based design questions: You are given a description of a workload, such as a MySQL database with high IOPS requirements, a log processing system with high throughput, or a file server with infrequent access. You must select the most appropriate EBS volume type. For example, a question might describe an application that requires 10,000 IOPS consistently and low latency. The answer would be io2 or io1 volumes. Another question might describe a big data workload that processes terabytes of data sequentially, where throughput is more important than IOPS. The correct choice would be st1 (Throughput Optimized HDD). 

 Troubleshooting questions: You may be asked why an application is slow. The answer often involves checking whether the EC2 instance is EBS-optimized, whether the volume is reaching its burst balance (for gp2), or whether the volume type is inappropriate for the workload. 

 Configuration questions: These test your knowledge of how to perform specific tasks. For example, how do you move an EBS volume from one Availability Zone to another? Correct answer: Create a snapshot, copy the snapshot to the target AZ, and create a volume from that snapshot. How do you encrypt an unencrypted volume? Answer: Create a snapshot, copy the snapshot with encryption enabled, then create a volume from the encrypted snapshot. 

 Cost optimization questions: You are asked to reduce storage costs for a non-critical application that is accessed rarely. The best choice is sc1 (Cold HDD). Or you are given a scenario where a team is using gp2 volumes for a database, and you need to recommend a more cost-effective alternative without sacrificing performance-gp3 is the answer because it offers baseline performance at a lower cost. 

 Disaster recovery questions: You must design a backup strategy using EBS snapshots. You need to know that snapshots are incremental, that they are stored in S3, and that they can be used to restore volumes to the same or different AZ/region.

## Example scenario

Company X runs an online store with a MySQL database that holds customer orders. The database is on an EC2 instance with a 200 GB gp2 EBS volume. Over time, the volume becomes 90% full. Also, the database needs more IOPS because of increased traffic. 

 The IT team needs to solve both problems without downtime. They check the current EBS volume and see that its performance is limited. They decide to modify the volume. Because EBS supports live modification, they can increase the size from 200 GB to 500 GB and change the volume type from gp2 to gp3, which provides a baseline of 3000 IOPS and can burst higher. They do this through the AWS Management Console without stopping the database. 

they want to protect against data loss. They set up automatic snapshots every 6 hours using Amazon Data Lifecycle Manager. These snapshots are incremental, so only changed data is saved after the first backup. They also copy nightly snapshots to a different AWS region for disaster recovery. 

 Two months later, a software bug corrupts several tables in the database. The team restores the database by creating a new EBS volume from the most recent snapshot taken just one hour before the corruption. They attach that new volume to a new EC2 instance, and the database is back online with minimal data loss. This scenario shows how EBS provides persistence, performance flexibility, and backup capabilities that are critical for production applications.

## Common mistakes

- **Mistake:** Thinking you can attach an EBS volume to EC2 instances in different Availability Zones
  - Why it is wrong: EBS volumes are tied to a single Availability Zone. You can only attach an EBS volume to an EC2 instance in the same AZ.
  - Fix: To use storage across AZs, create a snapshot of the volume, copy the snapshot to the target AZ, and create a new volume from it.
- **Mistake:** Believing that EBS snapshots are stored directly on EBS volumes
  - Why it is wrong: EBS snapshots are stored in Amazon S3, not on the EBS volume itself. This is why they persist even if the original volume is deleted.
  - Fix: Remember that snapshots live in S3, and can be used to create new volumes in any AZ or region.
- **Mistake:** Assuming that gp2 volumes are always cheaper than gp3
  - Why it is wrong: gp3 volumes have a lower base price per GB and include a baseline of 3000 IOPS and 125 MB/s throughput at no extra cost. gp2 volumes have a burst model that can be more expensive for consistent workloads.
  - Fix: For new volumes, always choose gp3 unless you need gp2's bursting capability for very short, high-demand spikes.
- **Mistake:** Thinking that you cannot resize or change the type of an EBS volume without downtime
  - Why it is wrong: EBS volumes can be modified (size, type, IOPS) without detaching from the instance, and the changes take effect without requiring a reboot in most cases.
  - Fix: Use the modify-volume API or console to adjust volume parameters while the volume is attached and in use.

## Exam trap

{"trap":"The exam asks: 'Which EBS volume type should you use for a low-cost, infrequently accessed data store?' The options include gp3, io2, st1, and sc1. Many learners pick gp3 because it is common, but the correct answer is sc1 (Cold HDD).","why_learners_choose_it":"Learners often default to gp3 because it is the most commonly recommended general-purpose volume. They forget that sc1 is specifically designed for cold data with the lowest cost per GB.","how_to_avoid_it":"Always read the scenario carefully for keywords like 'lowest cost', 'infrequently accessed', or 'cold data'. That immediately points to sc1. For high throughput needs, think st1. For low latency and high IOPS, think io2 or io1. For general purpose, gp3."}

## Commonly confused with

- **EBS vs EFS:** EBS is block storage attached to a single EC2 instance. EFS is file-level storage that can be mounted by multiple EC2 instances simultaneously across different Availability Zones. EBS is like a hard drive inside your computer; EFS is like a network shared folder everyone can access. (Example: If you need a database storage, use EBS. If you need a shared file system for multiple web servers, use EFS.)
- **EBS vs S3:** EBS provides block storage for EC2 instances with low latency. S3 is object storage for storing files, images, backups, and static website content accessible over the internet. EBS is attached to an EC2 instance; S3 is accessed via API calls. (Example: Store your operating system on EBS. Store user-uploaded photos in S3.)
- **EBS vs Instance Store:** Instance store provides temporary block storage physically attached to the host computer. Data is lost if the EC2 instance stops or fails. EBS provides persistent storage that survives instance stop/termination. (Example: Use instance store for temporary data like cache. Use EBS for databases that must persist.)

## Step-by-step breakdown

1. **Create an EBS Volume** — You specify the size (e.g., 100 GB), volume type (e.g., gp3), and Availability Zone. Optionally, you can enable encryption with KMS. AWS provisions the volume and makes it available in the chosen AZ.
2. **Attach the Volume to an EC2 Instance** — The volume is attached to an EC2 instance in the same AZ. The instance sees it as a new block device, like /dev/sdf. The volume remains attached even when the instance is stopped.
3. **Format and Mount the Volume** — Your operating system format the volume with a file system (e.g., ext4) and mounts it to a directory (e.g., /mnt/data). Now the application can read and write data.
4. **Take a Snapshot for Backup** — You create a point-in-time snapshot of the volume. The first snapshot copies the entire volume. Subsequent snapshots are incremental, saving only changed blocks, minimizing storage costs.
5. **Restore from Snapshot** — If the volume fails or data gets corrupted, you create a new volume from the most recent snapshot. You can attach it to a new or existing EC2 instance in the same or different AZ.
6. **Modify Volume Attributes** — You can increase size, change volume type, or adjust IOPS/throughput while the volume is in use. The changes take effect without rebooting the instance, allowing for dynamic performance adjustments.

## Practical mini-lesson

EBS is a foundational service that every AWS professional must master. In practice, you will spend a lot of time choosing the right volume type. Here is how to think like a pro. 

 Start with gp3 for most general-purpose workloads. It offers a baseline of 3000 IOPS and 125 MB/s throughput at no extra cost. If your application needs more, you can provision up to 16,000 IOPS and 1000 MB/s throughput by paying extra. This is great for web servers, small to medium databases, and development environments. 

 For production databases like Oracle, SQL Server, or MySQL that require consistent, high IOPS with low latency, use io2 or io1. io2 is the newer generation with 99.999% durability and higher IOPS limits. You pay for the provisioned IOPS, so only use it when necessary. 

 For big data, log processing, and data warehouses that read and write large blocks of data sequentially, st1 is the right choice. It offers high throughput at a lower cost than SSD volumes. For example, a Hadoop cluster processing terabytes of data benefits from st1. 

 For cold data that is accessed infrequently, like old backups or archived logs, use sc1. It is the cheapest per GB but has the lowest throughput. 

 Configuration in real life: Always enable encryption at rest for EBS volumes if your workload requires compliance. Use AWS Backup or Data Lifecycle Manager to automate snapshots. Monitor volume metrics via CloudWatch-look at VolumeQueueLength and BurstBalance for gp2 volumes to avoid performance degradation. 

 Common issues: Exceeding the burst balance on gp2 causes throttling. Solve by moving to gp3 or increasing volume size. For io2 volumes, ensure your EC2 instance is EBS-optimized and has enough network bandwidth. Also, remember that snapshots are stored in S3, and you can automate their lifecycle to delete old ones after a retention period.

## Memory tip

Remember EBS stands for Elastic Block Store. Think 'Elastic' because you can resize it easily. It is 'Block' storage, like a hard drive block-by-block. So EBS = virtual hard drive in the cloud.

## FAQ

**Can I attach an EBS volume to more than one EC2 instance at the same time?**

Yes, but only io2 volumes support multi-attach. You can attach a single io2 volume to up to 16 Nitro-based EC2 instances in the same Availability Zone. All attached instances must use a cluster-aware file system.

**What happens to my EBS volume when I stop an EC2 instance?**

The EBS volume remains attached to the instance and retains all data. You can start the instance later and continue where you left off. The volume persists independently of the instance lifecycle.

**How do I increase the size of an EBS volume without downtime?**

Use the Modify Volume feature in the AWS Console, CLI, or API. You can increase the size, change the type, or adjust IOPS/throughput while the volume is attached. After modification, you may need to extend the file system from within the OS.

**Are EBS snapshots incremental?**

Yes. Only the blocks that have changed since the last snapshot are saved. The first snapshot is a full copy. This reduces storage costs and speeds up subsequent snapshots.

**What is the difference between EBS and instance store?**

EBS provides persistent block storage that survives instance stops and terminations. Instance store is temporary storage physically attached to the host computer and data is lost when the instance stops or fails.

**Can I encrypt an existing unencrypted EBS volume?**

You cannot directly encrypt an existing volume. You must create a snapshot of the volume, copy the snapshot with encryption enabled, and then create a new encrypted volume from that snapshot.

## Summary

Amazon Elastic Block Store (EBS) is a fundamental storage service in AWS that provides persistent, block-level storage volumes for EC2 instances. It is the virtual hard drive for cloud computing, allowing you to store operating systems, applications, and data reliably. EBS volumes are tied to a single Availability Zone, offer multiple volume types (gp3, io2, st1, sc1) optimized for different workloads, and support snapshots for backup and disaster recovery. 

 In exams, especially the AWS Solutions Architect Associate, you need to know the characteristics of each volume type, how to modify volumes, how to encrypt data, and how to use snapshots for cross-region recovery. Common mistakes include confusing EBS with EFS or S3, thinking snapshots live on the volume, and forgetting that volumes are AZ-specific. 

 The key takeaway for IT professionals is that EBS enables decoupling of storage from compute, providing flexibility, scalability, and durability. Whether you are running a small web server or a large enterprise database, EBS is the storage backbone that makes it possible. Mastering EBS is essential for any AWS certification and for real-world cloud architecture.

---

Practice questions and the full interactive page: https://courseiva.com/glossary/ebs
