Dev.to WebDev 🛠 Dev 👁 0 📖 1 min read

Created EBS volume for the first time

Created EBS volume for the first time I’ve been learning AWS, and today I created my first EBS volume. Until now I had only launched EC2 instances, so I wanted to understand how storage works when you need data to stay

Created EBS volume for the first time

Created EBS volume for the first time

I’ve been learning AWS, and today I created my first EBS volume. Until now I had only launched EC2 instances, so I wanted to understand how storage works when you need data to stay safe even if the instance goes away.

What is EBS?
Elastic Block Store (EBS) is like a virtual hard drive you can attach to an EC2 instance. The data lives separately from the instance, so it stays even if you stop the instance.

What I did

1)Launched an EC2 instance named mo in the eu-north-1b Availability Zone

2)Went to EC2, then Volumes, then Create volume,Created a 10 GB volume


3)Attached the volume to my instance mo

4)Connected to the instance and checked the new disk with "lsblk"
Before:

After:

The mistake I made
My instance mo was in eu-north-1b, but I accidentally created the volume in eu-north-1a. When I tried to attach it, the volume didn’t show up as an option for my instance. I realized that an EBS volume can only attach to an instance in the same Availability Zone. So I created a new volume in eu-north-1b, and this time it attached without any problem.

What I learned

  • Always check your instance’s Availability Zone before creating a volume
  • Unused volumes still cost money, so I should delete the wrong one (eu-north-1a) so I don’t pay for it

If you’ve worked with EBS, what’s one mistake you made as a beginner? 🤔💭🎉

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.