Skip to main content

Command Palette

Search for a command to run...

Attaching and Mounting an EBS Volume to EC2

Published
2 min read
Attaching and Mounting an EBS Volume to EC2
B

Cloud Specialist with hands-on experience in Microsoft Azure, now transitioning into AWS. I’m focused on building, deploying, and optimizing cloud solutions while sharing my learning journey through real-world projects and documentation.

Introduction:
One of the most exciting parts of my AWS learning journey so far has been understanding how compute (EC2) and storage (EBS) work together.
This week, I took a big step by learning how to attach and mount an EBS volume to an EC2 instance — a hands-on task that gave me a deeper understanding of how cloud storage really functions in real life.


🧩 What I Did

After launching my EC2 instance, I created a new EBS volume in the same Availability Zone.
EBS (Elastic Block Store) is basically like attaching an extra hard drive to your virtual machine — giving you more space to store data, logs, or even backups.

I then:

  • Attached the volume to my EC2 instance.

  • Formatted it with the ext4 file system using:

      sudo mkfs -t ext4 /dev/xvdf
    
  • Created a directory called /data to mount it:

      sudo mkdir /data
      sudo mount /dev/xvdf /data
    
  • Verified that it was successfully mounted with df -h.

Seeing my /dev/xvdf volume show up under /data was such a satisfying moment — because it meant I had successfully connected AWS compute and storage just like a real Cloud Engineer.


🧠 What I Learned

  1. Separation of Compute and Storage
    EC2 instances can be stopped or replaced, but EBS volumes stay persistent — meaning your data is safe even when the instance is down.

  2. Scalability and Flexibility
    I can add or remove volumes anytime without disrupting the instance.

  3. Data Persistence and Backup
    Using EBS snapshots, I can create instant backups and restore them whenever needed.

  4. Real Cloud Mindset
    It taught me that in the cloud, you never “lose” data — you just manage where it lives.

🪴 Reflection

This project gave me a real feel for how AWS services connect and work together. What seemed like a small task at first turned out to be a powerful exercise in data persistence, scalability, and resilience — key pillars of cloud computing

More from this blog

"

"The Cloud Computing World"

38 posts

Exploring the evolving world of cloud computing, from Azure to AWS. This is where I document my hands-on projects, lessons learned, and growth as a Cloud Specialist.