CCL - Exp 5 - 122a1108
CCL - Exp 5 - 122a1108
An Amazon EC2 instance named Lab has already been launched for your lab.
6. Note the Availability Zone of the instance. It will look similar to us-
east-1a.
7. In the left navigation pane, choose Volumes.
You will see an existing volume that is being used by the Amazon EC2
instance. This volume has a size of 8 GiB, which makes it easy to distinguish
from the volume you will create next, which will be 1 GiB in size.
Your new volume will appear in the list, and will move from the Creating state
to the Available state. You may need to choose refresh to see your new
volume.
In this task you will attach the new EBS volume to the Amazon EC2 instance.
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."
In this task, you will connect to the EC2 instance using EC2 Instance Connect
which provides access to a terminal in the browser.
In this task, you will add the new volume to a Linux instance as an ext3 file
system under the /mnt/data-store mount point.
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:
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.
Your snapshot is displayed. The status will first have a state of Pending,
which means that the snapshot is being created. It will then change to a
state of Completed.
Note: Only used storage blocks are copied to snapshots, so empty blocks do
not occupy any snapshot storage space.
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/
If you ever wish to retrieve data stored in a snapshot, you can Restore the
snapshot to a new EBS volume.
Note: When restoring a snapshot to a new volume, you can also modify the
configuration, such as changing the volume type, size or Availability Zone.
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.
ls /mnt/data-store2/