Amazon Elastic Block Store Hands-On

Demo

In this demo, we will:

  1. Launch an EC2 instance
  2. Create and attach an EBS volume
  3. Connect to the EC2 instance
  4. Format and mount the EBS volume
  5. Write data to the EBS volume
  6. Create an EBS snapshot
  7. Test the setup
  8. Clean up resources

Agenda

Demo Overview

ebs-demo-1

Launch an instance

ebs-demo-key-pair-1

Create key pair

Create EBS volume

Success

Attach volume

Connect to instance

lsblk
sudo mkfs -t ext4 /dev/xvdf
sudo mkdir /mnt/ebs-volume
sudo mount /dev/xvdf /mnt/ebs-volume
df -h
cd /mnt/ebs-volume
cat test_file.txt
sudo chown ec2-user:ec2-user /mnt/ebs-volume
echo 'This is a test file on my EBS volume' > /mnt/ebs-volume/test_file.txt
sudo chmod 755 /mnt/ebs-volume

Create snapshot

Snapshot of EBS-Demo-Volume

Tags

Name
EBS-Demo-Snapshot

Unmount the existing volume

sudo umount /mnt/ebs-volume

Detach volume

Create volume from snapshot

Attach New Volume to EC2 

sudo mount /dev/xvdf /mnt/ebs-volume
cat /mnt/ebs-volume/test_file.txt

Clean Up

Force detach volume

Delete volume

Delete volume

Delete snapshot

Terminate (delete) instance

Delete security group

Volumes

🙏

Thanks

for

Watching