EBS(Elastic Block Storage)

0

Amazon EBS (Elastic Block Store) – The Backbone of EC2 Storage

In today’s cloud world, storage is one of the most crucial components for running reliable and high-performing applications.
When you launch an EC2 instance, you need persistent storage that can retain data even after the instance stops.
That’s where Amazon EBS (Elastic Block Store) comes in.


What is Amazon EBS?

Amazon EBS (Elastic Block Store) is a block-level storage service provided by AWS.
It provides durable, high-performance storage volumes that can be attached to EC2 instances, just like attaching a hard drive to your computer.

EBS volumes act as virtual hard disks for your EC2 instances — you can:

  • Store operating systems

  • Host databases

  • Keep application data

  • Perform backups and snapshots


Key Characteristics of EBS

Feature Description
Persistent Storage Data remains even after the EC2 instance stops or terminates (if volume not deleted).
Scalable You can easily increase the size, performance, or volume type without downtime.
Highly Available Automatically replicated within an Availability Zone (AZ).
Encrypted Supports data encryption at rest and in transit.
Snapshots You can take point-in-time backups (EBS Snapshots) stored in Amazon S3.

EBS vs Instance Store

Feature EBS Instance Store
Persistence Data persists even after instance stops. Data lost when instance stops/terminates.
Backup Snapshots supported. No snapshot capability.
Performance Consistent performance, scalable. Very fast but temporary.
Use Case Databases, critical data storage. Temporary cache, buffer data.

Types of Amazon EBS Volumes

AWS offers five main EBS volume types, categorized into SSD-backed (for performance) and HDD-backed (for throughput).


1. General Purpose SSD (gp3 / gp2)

Best for: Boot volumes, small-to-medium databases, development environments.

  • Balances price and performance.

  • Provides baseline IOPS with burst capability.

  • gp3 offers more flexibility — you can set IOPS and throughput independently.

Feature gp2 gp3
IOPS 3 IOPS per GB (max 16,000) Up to 16,000
Throughput Up to 250 MB/s Up to 1,000 MB/s
Durability 99.8%–99.9% 99.8%–99.9%

Example: Web servers, development, and testing environments.


2. Provisioned IOPS SSD (io2 / io1)

Best for: High-performance databases like Oracle, MySQL, PostgreSQL.

  • Designed for mission-critical workloads requiring high IOPS and low latency.

  • io2 offers higher durability (99.999%) and better performance consistency.

Feature io1 io2
Max IOPS 64,000 256,000
Durability 99.9% 99.999%
Use Case Databases, ERP systems Mission-critical databases

Example: Enterprise applications needing consistent, high throughput like SAP HANA or OLTP systems.


3. Throughput Optimized HDD (st1)

Best for: Big data, data warehouses, log processing.

  • HDD volume optimized for sequential read/write operations.

  • Offers high throughput at a lower cost than SSD.

Feature Value
Max Throughput 500 MB/s
Volume Size 125 GB – 16 TB
IOPS Up to 500
Durability 99.9%

Example: Streaming workloads, Hadoop clusters, data lakes.


4. Cold HDD (sc1)

Best for: Infrequently accessed data and archival workloads.

  • The lowest-cost HDD volume type.

  • Suitable for workloads where storage is large but performance is not critical.

Feature Value
Max Throughput 250 MB/s
Volume Size 125 GB – 16 TB
IOPS Up to 250
Durability 99.9%

🧠 Example: Backup storage, archives, older log data.


🧱 5. Magnetic (Standard) — Legacy

Best for: Rare use; older generation storage type.

  • Slower performance, replaced by gp3 and st1/sc1.

Example: Simple test workloads, rarely used today.


EBS Volume Types – Quick Comparison

Type Storage Medium Performance Cost Best For
gp3 / gp2 SSD Balanced 💰💰 General workloads
io2 / io1 SSD High IOPS 💰💰💰 Databases, ERP
st1 HDD High Throughput 💰 Big Data, Streaming
sc1 HDD Low Throughput 💰 (Cheapest) Backups, Cold Data
Magnetic HDD Low 💰 Legacy only

EBS Use Cases

Use Case Recommended EBS Type Description
Boot Volumes gp3/gp2 Fast, consistent startup performance.
Transactional Databases io2/io1 High IOPS and reliability.
Data Warehousing st1 High throughput for large sequential reads/writes.
Big Data Analytics st1/gp3 Handle large streaming datasets.
Backup and Archiving sc1 Low-cost storage for infrequently accessed data.
Development & Testing gp3 Cost-effective and flexible performance.

EBS Snapshots

Snapshots are point-in-time backups of your EBS volumes stored in Amazon S3.

✅ Benefits:

  • You can restore a volume from a snapshot anytime.

  • Used for disaster recovery or creating new volumes in other regions.

  • Snapshots are incremental, meaning only changed blocks are saved.


Real-World Example

🏦 A Financial Analytics Company

  • Uses io2 volumes for critical OLTP databases.

  • Uses gp3 for application servers.

  • Uses st1 for processing large transaction logs.

  • Takes daily EBS snapshots for backup and compliance.

Method 1: Using AWS Management Console

🔹 Step 1: Open the EC2 Dashboard

  • Go to AWS Management ConsoleEC2Elastic Block Store → Volumes.


🔹 Step 2: Create a New EBS Volume

  1. Click on “Create volume”.

  2. Choose the following:

    • Volume type (e.g., gp3, io2, st1, sc1)

    • Size (e.g., 20 GiB)

    • Availability Zone → Must match your EC2 instance’s AZ

    • (Optional) Snapshot ID if restoring from backup

  3. Click “Create volume.”

What is an EBS Snapshot?

An EBS Snapshot is a point-in-time backup of your EBS volume.
It’s stored in Amazon S3 (managed by AWS) — but you don’t manage S3 directly.
Snapshots can be:

  • Used to restore a new volume,

  • Copied to another region for disaster recovery,

  • Or used to create AMIs (Amazon Machine Images).


Method 1: Using AWS Management Console

Step 1: Open the EC2 Dashboard

Go to:
AWS Management Console → EC2 → Elastic Block Store → Volumes


 Step 2: Select the EBS Volume

  • From the Volumes list, select the volume you want to back up.


Step 3: Create Snapshot

  1. Click on Actions → Create snapshot.

  2. Fill in:

    • Description → e.g., “Backup of data volume on 2025-10-06”

    • (Optional) Tags → e.g., Key: Name, Value: DailyBackup

  3. Click “Create snapshot.”

Create Volume from Snapshot

Later, you can restore the snapshot:

  • Go to Snapshots → Select snapshot → Actions → Create volume from snapshot

  • Choose Availability Zone

  • Click Create volume

Steps to Create and Mount a New EBS Volume

Step 1: Check Attached Disks

lsblk

Lists all block devices and mount points.

fdisk -l

Shows detailed partition information for each disk.


Step 2: Create a Filesystem

sudo mkfs -t ext4 /dev/nvme1n1

Formats the new volume with an ext4 filesystem.
(Replace /dev/nvme1n1 with your actual device name.)


Step 3: Create a Mount Directory

sudo mkdir /mnt/data

Creates a folder where the new volume will be mounted.


Step 4: Mount the Volume

sudo mount /dev/nvme1n1 /mnt/data

Mounts the filesystem to the directory.


Step 5: Verify the Mount

df -h

Displays mounted filesystems and available space.


Step 6: (Optional) Check Disk Performance

iostat -x 1 3

Shows disk I/O performance metrics every 1 second for 3 iterations.


Step 7: Make Mount Permanent

echo '/dev/nvme1n1 /mnt/data ext4 defaults,nofail 0 2' | sudo tee -a /etc/fstab

Adds the mount entry to /etc/fstab so it persists after reboot.


Step 8: Final Verification

lsblk
df -h

Confirm the volume is mounted and persistent.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top