Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 1-14
Amazon Web Services Hands on EBS
December, 2012
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 2-14
Table of Contents Overview ....................................................................................................................................................... 3
Create EBS Volume ....................................................................................................................................... 4
Name the New Volume ............................................................................................................................. 6
Attach Volume to Linux Instance .................................................................................................................. 7
Configure Linux Instance to Use Volume .................................................................................................. 8
Attach Volume to Windows Instance ........................................................................................................... 9
Configure Windows Instance to Use Volume ......................................................................................... 10
Backup the Volume with a Snapshot .......................................................................................................... 13
Restore Snapshot ........................................................................................................................................ 14
Terminate Billable Services ............................................................................ Error! Bookmark not defined.
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 3-14
Overview This lab will walk the user through creating and using the Elastic Block Store service for leveraging block-
based storage in AWS. The following is high-level overview of this lab:
Create EBS Volume
Attach Volume to Instance
Configure Instance to use the virtual disk
Create a Snapshot
Restore the Snapshot
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 4-14
Create EBS Volume EBS volumes are created in specific Availability Zones. Therefore it is important to first determine the
location of the EC2 instance that will be receiving additional block storage. Log into the AWS console,
click on the EC2 tab, click on Instances under the Instances section in the menu on the left side of the
screen, select the instance and note the instance ID (i-57fec936 in this example) and Zone (if the Zone
column does not show up on your screen, it can be added by clicking on Show/Hide and adding a check
to “Zone”).
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 5-14
Click on Volumes under the Elastic Block Store section in the menu on the left side of the screen and on
the Create Volume button.
Enter a size of “1”, select the availability zone located earlier (us-east-1b in this example), and “---- No
Snapshot ----“ and click Yes, Create to create a 1 GB volume.
The new volume will show up in the management console with a status of “available”.
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 6-14
Name the New Volume
To help distinguish this volume from others, we will tag this volume with a name. Select the new
volume, click on the Tags tab, and click on the Add/Edit Tags button.
Provide a name for the volume and click Save Tags.
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 7-14
Attach Volume to Linux Instance To attach this volume to your instance, right click on the new volume and select Attach Volume.
Select the EC2 instance from the drop down menu, assign a device mapping for the drive
(/dev/xvdf for this lab), and click Yes, Attach.
The volume status will now change to in-use for this volume.
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 8-14
Configure Linux Instance to Use Volume
In this example we will be adding this additional 1 GB of storage to a Linux instance as an ext3
file system under the /mnt/data-store mount point. Use Putty or another client to SSH into your
Linux instance. Issue the following command to create an ext3 file system on the new volume:
$ sudo mkfs –t ext3 /dev/sdf
Make the directory for mounting the new storage:
$ 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 on boot, add the following line to
/etc/fstab (sudo vi /etc/fstab):
/dev/sdf /mnt/data-store ext3 defaults,noatime 1 2
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 9-14
Attach Volume to Windows Instance To attach this volume to your instance, right click on the new volume and select Attach Volume.
Select the EC2 instance from the drop down menu, assign a device mapping for the drive (xvdf
for this lab), and click Yes, Attach.
The volume status will now change to in-use for this volume.
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 10-14
Configure Windows Instance to Use Volume
In this example we will be adding this additional 1 GB of storage to a Windows instance.
1. Log in to your instance using Remote Desktop.
2. Open the Windows Server Manager: Start-> Administrative Tools->Server Manager
3. Navigate to Storage-> Disk Management
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 11-14
4. Right click on Disk 1 and select Online from the popup menu
5. Right click on Disk 1 and select Initialize Disk from the popup menu , leave the default
values and click on OK
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 12-14
6. Right click on Unallocated space and select New Simple Volume from the popup menu
7. Go through the wizard by clicking on Next button and choose 1021 MB as size, assign to
drive letter D, Format as NTFS and select Perform a quick format checkbox and click on
Finish at the end of the wizard.
8. Open the new drive D in Windows explorer and create a directory called folder on EBS
volume
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 13-14
Backup the Volume with a Snapshot Using the AWS Console EC2 tab, right-click the volume to be backed up (e.g. “New Data Volume”) and
select “Create Snapshot”. Although snapshots occur asynchronously, minimizing the amount of data
changes during the snapshot is recommended to increase the snapshot speed and to more easily line up
backup expectations with the point-in-time the snapshot is running. Snapshots of databases, for
example, are often taken from a read-replica that temporarily suspends replication activities during the
snapshot, and resumes after the snapshot has finished.
Provide a snapshot name and description and click “Yes, Create”
EBS Hands On
Copyright 2011-2012, Amazon Web Services, All Rights Reserved Page 14-14
Restore Snapshot To restore data from the snapshot, locate the desired snapshot from the “Snapshots” console link, right-
click on the “Create Volume from Snapshot” link. Then select the desired volume size, Availability Zone,
and click “Yes, Create”. After the data has been restored to a new volume, you can attach it to an
instance and mount the storage as per the previous steps. Since the new volume has pervious data, do
not create a new files system (mkfs in Linux) or format the drive (Windows). Simply mount the volume
(Linux) or assign a new drive letter (Windows) and start using the existing file system and data
immediately.