AWS Builder Center
AWS EBS (Elastic Block Store): A Beginner's Guide

AWS EBS (Elastic Block Store): A Beginner's Guide

When we launch an EC2 instance in AWS, we need storage to save operating system files, applications, databases, and other important data.

Aspiring DevOps Engineer | AWS & Cloud Learner
Understanding AWS EBS (Elastic Block Store): A Beginner's Guide
Introduction
When we launch an EC2 instance in AWS, we need storage to save operating system files, applications, databases, and other important data.
This is where Amazon Elastic Block Store (EBS) comes in.
Amazon EBS is a block-level storage service provided by AWS. It provides persistent storage volumes that can be attached to EC2 instances.
In simple words, AWS EBS works like a hard disk for an EC2 instance.
In this article, we will understand what EBS is, why we need it, how it works, and its basic features.
1. What Is AWS EBS?
Amazon Elastic Block Store (EBS) is a storage service that provides block-level storage for Amazon EC2 instances.
It allows users to store important data such as:
- Operating system files - Application files - Database information - Website content - Logs and configuration files
An EBS volume behaves like a virtual hard drive that can be attached to an EC2 instance.
2. Why Do We Need AWS EBS?
Let's understand with a real-life example.
Imagine you have a laptop. You use its hard drive to store documents, applications, videos, and other files.
Similarly, an EC2 instance needs storage to save its operating system, applications, and data.
AWS EBS helps us provide this storage.
Main reasons to use EBS:
- To store important application data. - To install and run operating systems. - To store database files. - To increase storage capacity when required. - To create backups of important data. - To keep data even when an EC2 instance is stopped.
3. Important Features of AWS EBS
1. Persistent Storage
Data stored on an EBS volume remains available even when an EC2 instance is stopped or restarted.
2. Scalability
You can increase the size of an EBS volume according to your storage requirements.
3. Snapshots
You can create point-in-time backups of EBS volumes using snapshots.
4. Encryption
EBS supports encryption to protect stored data.
5. High Availability
EBS automatically replicates volume data within its Availability Zone to protect against hardware failures.
6. Flexible Storage
AWS offers different EBS volume types for different application requirements.
4. Types of AWS EBS Volumes
AWS provides different types of EBS volumes.
SSD-Based Volumes
General Purpose SSD (gp3)
- Suitable for most applications. - Good for general workloads. - Commonly used for EC2 boot volumes.
General Purpose SSD (gp2)
- Older general-purpose SSD option. - Performance depends on volume size.
Provisioned IOPS SSD (io2)
- Designed for high-performance applications. - Suitable for critical database workloads.
HDD-Based Volumes
Throughput Optimized HDD (st1)
- Suitable for frequently accessed data. - Useful for log processing and big data workloads.
Cold HDD (sc1)
- Suitable for less frequently accessed data. - Designed for lower-cost storage.
Note: HDD-based volumes cannot be used as EC2 boot volumes.
5. What Is an EBS Volume?
An EBS volume is a virtual storage device that can be attached to an EC2 instance.
For example:
Suppose you have an EC2 instance with an 8 GiB root volume.
Later, your application requires more storage.
You can create another EBS volume of 10 GiB and attach it to the same EC2 instance.
Now your instance has additional storage for application files and other data.
6. What Is an EBS Snapshot?
An EBS Snapshot is a point-in-time backup of an EBS volume.
For example:
Suppose you are running a website on an EC2 instance and storing important files on an EBS volume.
Before making major changes, you can create a snapshot.
If something goes wrong, you can create a new volume from that snapshot and recover the backed-up data.
Benefits of EBS Snapshots:
- Data backup. - Disaster recovery. - Data restoration. - Creating copies of storage volumes.
7. How to Create an EBS Volume in AWS
Let's understand the basic process using the AWS Management Console.
Step 1: Open AWS Console
- Login to AWS Management Console. - Search for EC2. - Open the EC2 Dashboard.
Step 2: Open Volumes
- Go to Elastic Block Store. - Click Volumes. - Click Create Volume.
Step 3: Configure the Volume
- Select Volume Type: gp3. - Enter Size: 10 GiB. - Select the same Availability Zone as your EC2 instance. - Click Create Volume.
Step 4: Attach the Volume
- Select the newly created volume. - Click Actions. - Select Attach Volume. - Choose your EC2 instance. - Click Attach Volume.
Your EBS volume is now attached to your EC2 instance.
8. Basic Linux Commands to Check EBS Storage
After attaching the volume, connect to your Linux EC2 instance using SSH.
Check available disks:
"lsblk"
Displays the available block devices.
Check disk space:
"df -h"
Displays mounted filesystems and available storage.
Create a directory:
"sudo mkdir /data"
Creates a directory named data.
Mount the volume:
"sudo mount /dev/xvdf /data"
Mounts the filesystem at the "/data" directory, assuming "/dev/xvdf" is the correct formatted device.
Note: Device names can differ depending on the EC2 instance. Identify the correct disk before formatting or mounting it. A new empty disk needs a filesystem before it can be mounted.
9. Important Things to Remember
- EBS provides persistent block storage. - EBS volumes are attached to EC2 instances. - An EBS volume and its EC2 instance must be in the same Availability Zone for normal attachment. - Snapshots help create backups. - You can increase EBS volume size. - EBS volumes can continue generating charges even when an EC2 instance is stopped. - Always delete unused volumes and snapshots to avoid unnecessary costs.
10. Conclusion
Amazon EBS is an important storage service in AWS. It allows us to store application files, databases, operating system data, and other important information.
For beginners learning AWS and Cloud Computing, understanding EBS is an essential step.
Instead of only learning its definition, try creating an EBS volume, attaching it to an EC2 instance, and checking the storage using Linux commands.
Remember: EBS provides persistent storage for your EC2 instances.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article