Name

ec2-attach-volume

Synopsis

ec2-attach-volume volumeid -i instanceid -d device

Attaches an existing elastic block storage volume to a running EC2 instance, exposing it to the instance as the specified device. The proper device name is platform-dependent, with Linux variants expecting device names such as /dev/sdh and Windows expecting device names such as xvdh.

With the block storage volume attached to your instance, you can mount and format it from the instance using the operating-system-specific disk management utilities.

The command output describes the state of the attaching volume with its attachment information.

Example

$ ec2-attach-volume vol-81aeb37f -i i-12b3ff6a -d /dev/sdf
ATTACHMENT vol-81aeb37f i-12b3ff6a /dev/sdf attaching 2008-12-17T22:36:00+0000

Get Cloud Application Architectures now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.