0% found this document useful (0 votes)
18 views9 pages

CCL - Exp 5 - 122a1108

This document outlines Experiment No. 5 conducted by Tanish Srinivasan, focusing on implementing Storage as a Service using AWS services. It details tasks such as creating and attaching an EBS volume to an EC2 instance, configuring a file system, creating and managing snapshots, and restoring data from snapshots. The experiment emphasizes practical steps for managing storage in AWS, including commands for Linux systems and AWS console navigation.

Uploaded by

Tanishq p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views9 pages

CCL - Exp 5 - 122a1108

This document outlines Experiment No. 5 conducted by Tanish Srinivasan, focusing on implementing Storage as a Service using AWS services. It details tasks such as creating and attaching an EBS volume to an EC2 instance, configuring a file system, creating and managing snapshots, and restoring data from snapshots. The experiment emphasizes practical steps for managing storage in AWS, including commands for Linux systems and AWS console navigation.

Uploaded by

Tanishq p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Experiment No.

Name: Tanish Srinivasan


Roll No.: 122A1108
Date: 04/04/2025
TE/CE-D/D-2/CCL
Aim: To study and Implement Storage as a Service using Own Cloud/ AWS S3,
Glaciers/ Azure Storage.
Task 1: Create a New EBS Volume
In this task, you will create and attach an Amazon EBS volume to a new
Amazon EC2 instance.

4. In the AWS Management Console, in the search box next to Services ,


search for and select EC2.
5. In the left navigation pane, choose Instances.

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.

8. Choose Create volume then configure:


a. Volume Type: General Purpose SSD (gp2)
b. Size (GiB): 1. NOTE: You may be restricted from creating large
volumes.
c. Availability Zone: Select the same availability zone as your
EC2 instance.
d. Choose Add tag
e. In the Tag Editor, enter:
i. Key: Name
ii. Value: My Volume

9. Choose Create Volume

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.

Task 2: Attach the Volume to an Instance

In this task you will attach the new EBS volume to the Amazon EC2 instance.

10. Select My Volume.

11. In the Actions menu, choose Attach 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."

13. Choose Attach volume

The volume state is now In-use.


Task 3: Connect to Your Amazon EC2 Instance

In this task, you will connect to the EC2 instance using EC2 Instance Connect
which provides access to a terminal in the browser.

14. In the AWS Management Console, in the search box next to


Services , search for and select EC2.

15. Choose Instances.

16. Select the Lab instance, and then choose Connect.

17. On the EC2 Instance Connect tab, choose Connect.

An EC2 Instance Connect terminal session opens and displays a $ prompt.

Task 4: Create and Configure Your File System

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.

18. View the storage available on your instance:

Run the following command:

df -h

You should see output similar to:

Filesystem Size Used Avail Use% Mounted on


devtmpfs 4.0M 0 4.0M 0% /devtmpfs 475M
0 475M 0% /dev/shmtmpfs 190M 2.8M 188M 2%
/run/dev/xvda1 8.0G 1.6G 6.5G 20% /tmpfs 475M
0 475M 0% /tmptmpfs 95M 0 95M 0%
/run/user/1000

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.

19. Create an ext3 file system on the new volume:

sudo mkfs -t ext3 /dev/sdf

The output should indicate that a new file system was created on the
attached volume.

20. Create a directory for mounting the new storage volume:

sudo mkdir /mnt/data-store

21. Mount the new volume:

sudo mount /dev/sdf /mnt/data-store

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:

echo "/dev/sdf /mnt/data-store ext3 defaults,noatime 1 2" |


sudo tee -a /etc/fstab

22. View the configuration file to see the setting on the last line:

cat /etc/fstab

23. View the available storage again:

df -h

The output will look similar to what is shown below.

Filesystem Size Used Avail Use% Mounted on


devtmpfs 484M 0 484M 0% /devtmpfs 492M
0 492M 0% /dev/shmtmpfs 492M 460K 491M 1%
/runtmpfs 492M 0 492M 0%
/sys/fs/cgroup/dev/xvda1 8.0G 1.5G 6.6G 19% /tmpfs
99M 0 99M 0% /run/user/0tmpfs 99M 0 99M
0% /run/user/1000/dev/xvdf 976M 1.3M 924M 1%
/mnt/data-store

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.

sudo sh -c "echo some text has been written >


/mnt/data-store/file.txt"

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.

Task 5: Create an Amazon EBS Snapshot

In this task, you will create a snapshot of your EBS volume.


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.

27. In the Actions menu, select Create snapshot.

28. Choose Add tag then configure:


a. Key: Name
b. Value: My Snapshot
c. Choose Create snapshot

29. In the left navigation pane, choose Snapshots.

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

31. Verify that the file has been deleted.

ls /mnt/data-store/

Your file has been deleted.

Task 6: Restore the Amazon EBS Snapshot

If you ever wish to retrieve data stored in a snapshot, you can Restore the
snapshot to a new EBS volume.

Create a Volume Using Your Snapshot

32. In the EC2 console, select My Snapshot.

33. In the Actions menu, select Create volume from snapshot.


34. For Availability Zone, select the same availability zone that you
used earlier.

35. Choose Add tag then configure:


a. Key: Name
b. Value: Restored Volume
c. Choose Create 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.

Attach the Restored Volume to Your EC2 Instance

36. In the left navigation pane, choose Volumes.

37. Select Restored Volume.

38. In the Actions menu, select Attach volume.

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.

40. Choose Attach volume

The volume state is now in-use.

Mount the Restored Volume

41. Create a directory for mounting the new storage volume:

sudo mkdir /mnt/data-store2


42. Mount the new volume:

sudo mount /dev/sdg /mnt/data-store2

43. Verify that volume you mounted has the file that you created
earlier.

ls /mnt/data-store2/

You should see file.txt.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy