Day 24 of #90DaysOfCloud: Mastering EBS Volumes, AMIs, Snapshots, and Cross-Region Copying

Pratik DasPratik Das
3 min read

Today’s journey was focused on one of the core aspects of AWS EC2 storage and backup management — EBS volumes, AMI creation, snapshot handling, and cross-region replication. These concepts are essential when architecting fault-tolerant, scalable, and highly available cloud infrastructures.


☁️ What We Covered Today

  • Attaching and formatting EBS volumes

  • Mounting EBS volumes on EC2 instances

  • Setting up automatic mounting using /etc/fstab

  • Creating AMI (Amazon Machine Images) from instances

  • Taking EBS snapshots

  • Copying snapshots to different regions


🧱 Step-by-Step EBS + AMI + Snapshot Workflow

✅ 1. Launch EC2 Instance

  • OS: Amazon Linux 2

  • Type: t2.micro (Free Tier)

  • Allow SSH (port 22) in Security Group

SSH into the instance:

ssh -i "your-key.pem" ec2-user@<EC2-Public-IP>

✅ 2. Create and Attach EBS Volume

Navigate to EC2 > Elastic Block Store > Volumes:

  • Create new volume (e.g. 1 GiB, same AZ as instance)

  • After creation, click "Actions > Attach Volume"

  • Choose instance and attach as /dev/xvdf

✅ 3. Format and Mount EBS Volume

# Check for attached volume
lsblk

# Format the volume
sudo mkfs -t xfs /dev/xvdf

# Create a mount point
sudo mkdir /mnt/ebs-volume

# Mount the volume
sudo mount /dev/xvdf /mnt/ebs-volume

# Verify
df -h

✅ 4. Make Mount Persistent (Re-Mount on Reboot)

Get UUID of device:

sudo blkid /dev/xvdf

Edit fstab:

sudo vim /etc/fstab

Add this line (replace UUID appropriately):

UUID=<your-uuid> /mnt/ebs-volume xfs defaults,nofail 0 2

Test fstab:

sudo mount -a

📸 5. Create AMI from EC2 Instance

This captures your full instance state for reuse or backup:

  • Go to EC2 > Instances

  • Select instance > Actions > Image and templates > Create image

  • Provide a name and description

  • Click "Create Image"

View AMIs under: EC2 > AMIs

You can now launch identical EC2 instances from this image.


💾 6. Take EBS Snapshot

To back up a volume:

  • Go to EC2 > Volumes

  • Select the volume > Actions > Create Snapshot

  • Provide a name and description

Find it under: EC2 > Snapshots


🌍 7. Copy Snapshot to Another Region

Enable cross-region backup/disaster recovery:

  • Go to EC2 > Snapshots

  • Select snapshot > Actions > Copy Snapshot

  • Choose destination region

  • Enable encryption (optional)

  • Click Copy

Now, the snapshot is replicated and can be used to launch volumes in another region.


🧠 Best Practices

  • Use snapshots to regularly back up important data

  • Automate snapshot lifecycle using AWS Backup

  • Use AMIs to quickly replicate infrastructure

  • Store backups in a different region for redundancy


📅 What’s Next?

Tomorrow is Day 25 → we’ll dive into Load Balancing and Auto Scaling — essential topics for building scalable, fault-tolerant cloud-native applications.


Stay tuned and follow along as we grow our cloud skills every day. ☁️

#AWS #EBS #EC2 #Snapshots #CrossRegion #AMI #Cloud #DevOps #90DaysOfCloud

0
Subscribe to my newsletter

Read articles from Pratik Das directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Pratik Das
Pratik Das