ec2-attach-volume volume_id --instance instance_id --device device
volume_id
instance_id
device
Attaches an Amazon EBS volume to an instance and exposes it as the specified device.
The ID of the Amazon EBS volume
Example: vol-4d826724
vol-4d826724
Yes
--instance instance_id
The ID of the instance to which the volume will attach Volumes can only attach to instances in the same availability zone.
Example: i-6058a509
i-6058a509
--device device
Specifies how the device is exposed to the instance. This value is operating system dependent.
Example: /dev/sdh (Linux)
/dev/sdh
Amazon EBS returns a table that contains the following information:
ATTACHMENT identifier
ID of the volume
ID of the instance
The device as it is exposed to the instance
Volume state (e.g., attaching, attached)
attaching
attached
Time stamp when attachment initiated
Amazon EBS displays errors on stderr.
stderr
This example attaches volume vol-4d826724 to instance i-6058a509 and exposes it as /dev/sdh. For information on standard storage locations, see
$ ec2-attach-volume vol-4d826724 --instance i-6058a509 --device /dev/sdh ATTACHMENT vol-4d826724 i-6058a509 /dev/sdh attaching 2008-02-14T00:15:00+0000
$
ATTACHMENT vol-4d826724 i-6058a509 /dev/sdh attaching 2008-02-14T00:15:00+0000
ec2-create-volume
ec2-delete-volume
ec2-describe-volumes
ec2-detach-volume
Submit feedback about this site to: