Lab 13
Lab 13
Lab Overview
This lab focuses on Amazon Elastic Block Store (Amazon EBS), a key underlying storage mechanism
for Amazon EC2 instances. In this lab, you will learn how to create an Amazon EBS volume, attach it
to an instance, apply a file system to the volume, and then take a snapshot backup.
Topics covered
By the end of this lab, you will be able to:
Create an Amazon EBS volume
Attach and mount your volume to an EC2 instance
Create a snapshot of your volume
Create a new volume from your snapshot
Attach and mount the new volume to your EC2 instance
Duration
This lab will require approximately 30 minutes to complete.
https://labs.vocareum.com/main/main.php?m=clabide&mode=s&asnid=3687885&stepid=3687886&hideNavBar=1 1/9
12/9/24, 11:57 AM Workbench - Vocareum
block device.
When used as a boot partition, Amazon EC2 instances can be stopped and subsequently restarted,
enabling you to pay only for the storage resources used while maintaining your instance's state.
Amazon EBS volumes offer greatly improved durability over local Amazon EC2 instance stores
because Amazon EBS volumes are automatically replicated on the backend (in a single Availability
Zone).
For those wanting even more durability, Amazon EBS provides the ability to create point-in-time
consistent snapshots of your volumes that are then stored in Amazon Simple Storage Service
(Amazon S3) and automatically replicated across multiple Availability Zones. These snapshots can be
used as the starting point for new Amazon EBS volumes and can protect your data for long-term
durability. You can also easily share these snapshots with co-workers and other AWS developers.
This lab guide explains basic concepts of Amazon EBS in a step-by-step fashion. However, it can only
give a brief overview of Amazon EBS concepts. For further information, see the Amazon EBS
documentation.
2. To connect to the AWS Management Console, choose the AWS link in the upper-left corner.
https://labs.vocareum.com/main/main.php?m=clabide&mode=s&asnid=3687885&stepid=3687886&hideNavBar=1 2/9
12/9/24, 11:57 AM Workbench - Vocareum
3. Arrange the AWS Management Console tab so that it displays along side these instructions.
Ideally, you will be able to see both browser tabs at the same time, to make it easier to follow the
lab steps.
6. Note the Availability Zone of the instance. It will look similar to us-east-1a.
Value: My Volume
12. Choose the Instance field, then select the Lab instance.
Note that the Device name is set to /dev/sdf. Notice also the message displayed that "Newer
Linux kernels may rename your devices to /dev/xvdf through /dev/xvdp internally, even when the
device name entered here (and shown in the details) is /dev/sdf through /dev/sdp."
https://labs.vocareum.com/main/main.php?m=clabide&mode=s&asnid=3687885&stepid=3687886&hideNavBar=1 4/9
12/9/24, 11:57 AM Workbench - Vocareum
df -h
The output shows that the original 8GB /dev/xvda1 disk volume mounted at / which indicates that
it is the root volume. It hosts the Linux operating system of the EC2 instance.
The 1GB other volume that you attached to the Lab instance is not listed, because you have not
yet created a file system on it or mounted the disk. Those actions are necessary so that Linux
operating system can make use of the new storage space. You will take those actions next.
The output should indicate that a new file system was created on the attached volume.
To configure the Linux instance to mount this volume whenever the instance is started, you will
need to add a line to /etc/fstab. Run the command below to accomplish that:
https://labs.vocareum.com/main/main.php?m=clabide&mode=s&asnid=3687885&stepid=3687886&hideNavBar=1 5/9
12/9/24, 11:57 AM Workbench - Vocareum
22. View the configuration file to see the setting on the last line:
cat /etc/fstab
df -h
Notice the last line. The output now lists /dev/xvdf which is the new mounted volume.
24. On your mounted volume, create a file and add some text to it.
25. Verify that the text has been written to your volume.
cat /mnt/data-store/file.txt
Leave the EC2 Instance Connect session running. You will return to it later in this lab.
https://labs.vocareum.com/main/main.php?m=clabide&mode=s&asnid=3687885&stepid=3687886&hideNavBar=1 6/9
12/9/24, 11:57 AM Workbench - Vocareum
You can create any number of point-in-time, consistent snapshots from Amazon EBS volumes at any
time. Amazon EBS snapshots are stored in Amazon S3 with high durability. New Amazon EBS
volumes can be created out of snapshots for cloning or restoring backups. Amazon EBS snapshots
can also be easily shared among AWS users or copied over AWS regions.
26. In the EC2 Console, choose Volumes and select My Volume.
30. In your EC2 Instance Connect session, delete the file that you created on your volume.
sudo rm /mnt/data-store/file.txt
ls /mnt/data-store/
https://labs.vocareum.com/main/main.php?m=clabide&mode=s&asnid=3687885&stepid=3687886&hideNavBar=1 7/9
12/9/24, 11:57 AM Workbench - Vocareum
34. For Availability Zone, select the same availability zone that you used earlier.
39. Choose the Instance field, then select the Lab instance that appears.
Note that the Device field is set to /dev/sdg. You will use this device identifier in a later task.
43. Verify that volume you mounted has the file that you created earlier.
https://labs.vocareum.com/main/main.php?m=clabide&mode=s&asnid=3687885&stepid=3687886&hideNavBar=1 8/9
12/9/24, 11:57 AM Workbench - Vocareum
ls /mnt/data-store2/
https://labs.vocareum.com/main/main.php?m=clabide&mode=s&asnid=3687885&stepid=3687886&hideNavBar=1 9/9