How to Attach the Volume to an Instance
This section describes how to attach a volume that you created to an instance.
Note | |
---|---|
Windows instances currently support devices xvda through xvdp. Devices xvda and xvdb are reserved by the operating system, xvdc is assigned to drive C:\, and, depending on the instance type, devices xvdd through xvde might be reserved by the instance stores. Any device that is not reserved can be attached to an Amazon EBS volume. For a list of devices that are reserved by the instance stores, see Instance Storage. |
AWS Management Console
To attach an Amazon EBS volume
-
Log in to the AWS Management Console and click the Amazon EC2 tab.
-
Click Volumes in the Navigation pane.
The console displays a list of current volumes.
-
Click Create Volume.
The Create Volume dialog box appears.
-
Select a volume and click Attach Volume.
The Attach Volume dialog box appears.
-
Select the instance to which the volume will attach from the Instance list box.
-
Select how the device is exposed to the instance from the Device list box.
-
Click Attach.
The volume is attached to the instance.
Command Line Tools
To attach an Amazon EBS volume
-
Enter the following command.
PROMPT>
volume_id
-iinstance_id
-ddevice
Amazon EBS returns information similar to the following.
ATTACHMENT
volume_id
instance_id
device
attachingdate_time
Example
This example attaches volume vol-4d826724
to instance i-6058a509
in Linux and UNIX and exposes it as device /dev/sdh
.
PROMPT>
ec2-attach-volume vol-4d826724 -i i-6058a509 -d /dev/sdh
ATTACHMENT vol-4d826724 i-6058a509 /dev/sdh attaching 2008-02-14T00:15:00+0000
This example attaches volume vol-4d826724
to instance i-6058a509
in Windows and exposes it as device xvdf
.
PROMPT>
ec2-attach-volume vol-4d826724 -i i-6058a509 -d xvdf
ATTACHMENT vol-4d826724 i-6058a509 xvdf attaching 2008-02-14T00:15:00+0000