|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
After you attach an Amazon EBS volume to your instance, it is exposed as a block device. You can format the volume with any file system and then mount it. After you make the Amazon EBS volume available for use, you can access it in the same ways that you access any other volume. You can also take snapshots of your Amazon EBS volume for backup purposes or to use as a baseline when you create another volume.
This topic describes how to make your Amazon EBS volume available for use.
To make an Amazon EBS volume available for use on Linux
Connect to your instance using SSH.
Depending on the block device driver of your instance's kernel, the device may be
attached with a different name than what you specify. For example, if you specify a
device name of
/dev/sdh, your device may be renamed
/dev/hdh by the kernel; in some
cases, even the trailing letter may also change (where
/dev/xvde). Amazon Linux AMIs create a symbolic link from
the renamed device path to the name you specify, but other AMIs may behave
Use the lsblk command to view your available disk devices and their mount points (if applicable) to help you determine the correct device name to use.
lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda1 202:1 0 8G 0 disk / xvdh 202:112 0 100G 0 disk
/dev/xvda1 is mounted as the root device, and
/dev/xvdh is attached, but it has not been mounted yet. The
df -h and sudo fdisk -l commands also provide
valuable information about disk space and partitions.
(Optional) Use the following command to create an ext3 file system on the volume.
This step assumes that you're mounting an empty volume. If you're mounting a volume that already has data on it (for example, a volume that was restored from a snapshot), don't use mkfs before mounting the volume (skip to the next step instead). Otherwise, you'll format the volume and delete the existing data.
sudo mkfs -t ext3
Use the following command to create the directory.
Use the following command to mount the volume.
(Optional) To enable the instance to reconnect to an Amazon EBS volume on reboot, add the device to the fstab or create a script that automatically mounts the volume on startup.
To use an Amazon EBS volume
Log in to your instance using Remote Desktop.
Windows Server 2012: Go to the Start screen.
Windows Server 2008: On the taskbar, click Start, and then click Run.
Type diskmgmt.msc and press Enter. The Disk Management utility opens.
If you're mounting a volume that already has data on it (for example, a public data set), make sure you don't reformat the volume and delete the existing data.
Select the disk that represents the new Amazon EBS volume.
On the Disk Management menu, select Action - All Tasks - Online.
A new disk needs to be initialized before it can be used. To initialize the disk:
In the Disk Management utility, select the new Amazon EBS volume disk.
On the Disk Management menu, select Action - All Tasks - Initialize Disk.
In the Initialize Disk dialog, select the disk to initialize, select the desired partition style, and press OK.
Your new Amazon EBS volume is now available for use. Any data written to this file system is written to the Amazon EBS volume and is transparent to applications using the device.