EBS Explained: Everything You Need to Know

What is EBS volume

An EBS (Elastic Block Store) volume is a network drive you can attach to your instances while they run.

It allows your instances to persist data, even after their termination.

  • They can only be mounted to one instance at a time.

  • They are bound to a specific availability zone.

EBS volume

It’s a network drive (not a physical drive).

  • It uses the network to communicate the instance, which means there might be a bit of latency.

  • It can be detached from an EC2 instance and attached to another one quicky.

Have a provisioned capacity (size in GBs & IOPS)

  • You can increase the capacity of the drive over time.

It’s locked to an Availability Zone (AZ).

  • To move a volume across, you first need to snapshot it.

EBS volume types :

  1. General purpose SSD ( gp2, gp3)

  2. Provisioned IOPS SSD (io 1, io 2)

  3. Through optimized HHD (St 1)

  4. Cold HDD (sc 1)

  5. Magnetic standard

How to create a new disk in running EC2 windows instance.

Create New EBS volumes

  1. login in your AWS Management Console.

  2. Go to EC2 Dashboard.

  3. In the left sidebar, click "Volumes" under Elastic Block Store.

  4. Click "Create Volume".

  5. Volume Type : (Ex. :General Purpose SSD gp3).

  6. Size : (Enter how many GiB (Ex. : 1 GiB) ).

  7. Availability Zone : (It must match the AZ of your EC2 instance (Ex. : ap - south - 1b).

  8. IOPS : ( as per your requirement (Ex . 3000))

  9. Throughtput (Mib/s) : 125

  10. Click "Create Volume".

Attach EBS volume to EC2 Instance

  1. In the Volumes list, select your new volume.

  2. Click "Actions" Select "Attach Volume".

  3. Select your running EC2 instance

  4. Device Name : (Ex. : /dev/sdf)

  5. Click Attach Volume.

EBS Snapshot :

In (AWS) A snapshot is a point-in-time copy of an EBS volume that’s used for data protection and backup.

  • Make a backup (snapshot) of your EBS volume at a point in time.

  • Not necessary to detach volume to do snapshot, but recommended.

  • Can copy snapshot across Availability Zone or region.

How to Create an EBS Snapshot

  1. login in your AWS Management Console.

  2. Go to EC2 Dashboard.

  3. In the left sidebar, click "Volumes" under Elastic Block Store.

  4. Select the volume (you want to back up).

  5. Click "Actions" Select "Create Snapshot".

  6. Name : (EX. : Demosnapshot).

  7. Description: (Optional).

  8. Click "Create Snapshot".

  9. In the left sidebar, Go to Snapshots under Elastic Block Store.

How to Recreate a Volume from an EBS Snapshot

  1. In the left sidebar, Go to Snapshots under Elastic Block Store.

  2. Select the snapshot.

  3. Click "Actions" Select "Create Volume".

  4. Availability Zone : (It must match the AZ of your EC2 instance).

  5. Volume Type: (as per your requirement).

  6. Size : (Default).

  7. Click "Create Volume".

AMI

AMI (Amazon machine Image)

AMI are customization of an EC2 instance.

  • You add your own software, configuration, operating system; monitoring.

  • Faster boot/ configuration time because all your software is pre-packed.

AMI are built for a specific region and can be copied across regions.

You can launch EC2 instance from

  • A public AMI : AWS provided.

  • Your own AMI you make and maintain them yourself.

AMI process : (From an EC2 Instance)

  • Start an EC2 instance and customize it.

  • Stop the instance (for data integrity).

  • Build an AMI : this will also create EBS Snapshot.

  • Launch instance from other AMI.

How to create Amazon Machine Image :

  1. Go to EC2 Dashboard.

  2. Select the instance you want to create an AMI from.

  3. Click Actions Select Image and templates Select Create image.

  4. Create image Select Image name (give name ).

  5. Tag image and snapshot together or Tag image and snapshot separately select any one.

  6. Create image.

Conclusion :

Amazon Elastic Block Store (EBS) is a versatile and essential component of AWS infrastructure, providing persistent storage for EC2 instances. With various volume types tailored to different performance needs, EBS offers flexibility and scalability for diverse workloads. Understanding how to create, attach, and manage EBS volumes, as well as utilizing snapshots and AMIs, empowers users to optimize their cloud storage solutions effectively. By leveraging these features, businesses can ensure data durability, enhance application performance, and streamline their cloud operations.

1
Subscribe to my newsletter

Read articles from Tambadkar Rohit Yashwant directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Tambadkar Rohit Yashwant
Tambadkar Rohit Yashwant

Learning DevOps Engineer passionate about cloud computing, containerization, and automation. Currently exploring Docker, AWS, and CI/CD pipelines to build scalable and efficient workflows. Documenting my learning journey in blog. stay tuned with me for learning.