Lab 4 3 Working with EBS - nicolas-tullio/Tech-Journal GitHub Wiki

Deliverables

Task 1 Screenshot of the Volume you created

image

Task 2: Screenshot showing attached volume

image

Task 4: Screenshot of cat command showing that you were able to create a file on the volume

image

Task 5: Screenshot showing completed snapshot

image

Task 6: Screenshot showing file from restored volume

image

Steps

Create a New EBS Volume

In the left navigation pane, choose Volumes

Create the following volume:

  • Volume Type: General Purpose SSD (gp2)
  • Size (GiB): 1. NOTE: You may be restricted from creating large volumes.
  • Availability Zone: Select the same availability zone as your EC2 instance.

image

Choose Add tag

  • In the Tag Editor, enter:
  • Key: Name
  • Value: My Volume

image

New Volume created

image

Attach the Volume to an Instance

Select My Volume then In the Actions menu, choose Attach volume

Choose the instance and device name

image

Volume is now In use

image

Connect to Lab instance

image

Create and Configure Your File System

Create an ext3 file system on the new volume:

sudo mkfs -t ext3 /dev/sdf

image

Create a directory for mounting the new storage volume:

sudo mkdir /mnt/data-store

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

image

View the available storage again:

df -h

image

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"

Verify that the text has been written to your volume.

cat /mnt/data-store/file.txt

image

Create an Amazon EBS Snapshot

Select My Volume and In the Actions menu, select Create snapshot

image image

Delete the file that you created on your volume and verify

sudo rm /mnt/data-store/file.txt ls /mnt/data-store/

image

Restore the Amazon EBS Snapshot

My Snapshot > select Create volume from snapshot > Restored Volume

image

Volumes > Restored Volume > Actions menu, select Attach volume

image

Mount the Restored Volume

Create a directory for mounting the new storage volume:

sudo mkdir /mnt/data-store2

Mount the new volume:

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

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

ls /mnt/data-store2/

image