|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
You can attach your Amazon EBS volume to one of your instances in the same Availability Zone.
To attach an Amazon EBS volume to an instance using the console
Open the Amazon EC2 console.
Click Volumes in the navigation pane.
Select a volume and then click Attach Volume.
In the Attach Volume dialog box, start typing the name or ID of the instance to attach the volume to in the Instance box, and select it from the list of suggestion options (only instances in the same Availability Zone as the volume are displayed). Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types.
Verify that the suggested device name is suitable, or enter a device name in the Device box. For more information about naming conventions and restrictions, see Device Naming.
Click Attach to attach the volume to the instance. The volume and instance must be in the same Availability Zone.
If a volume has an AWS Marketplace product code:
The volume can only be attached to the root device of a stopped instance.
You must be subscribed to the AWS Marketplace code that is on the volume.
The configuration (instance type, operating system) of the instance must support that specific AWS Marketplace code. For example, you cannot take a volume from a Windows instance and attach it to a Linux instance.
AWS Marketplace product codes are copied from the volume to the instance.
To attach an Amazon EBS volume to an instance using the command line
You can use one of the following commands. For more information about these command line interfaces, see Accessing Amazon EC2.
The following table lists the available device names on Amazon EC2. You can specify these names when attaching a volume to a running instance or when launching an instance using a block device mapping. The block device driver for the instance assigns the actual volume names when mounting the volumes, and these names can be different than the names that Amazon EC2 recommends. For more information about instance store volumes, see Amazon EC2 Instance Store. For information about the root device storage, see Amazon EC2 Root Device Volume.
|Virtualization Type||Available||Reserved for Root||Used for Instance Store Volumes||Recommended for EBS Volumes|
Differs by AMI
/dev/sda1 or /dev/xvda
Although you can attach your Amazon EBS volumes using the device names used to attach instance store volumes, we strongly recommend that you don't because the behavior can be unpredictable.
Depending on the block device driver of the kernel, the device might
be attached with a different name than what you specify. For example, if you specify
a device name of
/dev/sdh, your device might be renamed
/dev/hdh by the kernel; in
most cases, the trailing letter remains the same. In some versions of Red Hat
Enterprise Linux (and its variants, such as CentOS), even the trailing letter might
also change (where
/dev/sda could become
/dev/xvde). In these cases, each device name trailing letter
is incremented the same number of times. For example,
/dev/xvdg. Amazon Linux AMIs create a symbolic link from
the renamed device path to the name you specify, but other AMIs might behave
You cannot attach volumes that share the same device letters both with and without
trailing digits. For example, if you attach a volume as
another volume as
visible to the instance. To use trailing digits in device names, you must use
trailing digits on all device names that share the same base letters (such as
Hardware virtual machine (HVM) AMIs don't support the use of trailing numbers on device names.
Some custom kernels might have restrictions that limit use to
/dev/sd[f-p][1-6]. If you're having trouble using
/dev/sd[q-z][1-6], try switching
Although Amazon EC2 does not impose limitations on how many volumes you can attach to an instance, there are several factors you need to consider when attaching multiple volumes. The upper limit of volumes you should attach to your instance is dependent on your operating system (Linux instances can reliably handle more volumes than Windows instances). Another consideration is whether you need increased I/O bandwidth or increased storage capacity.
For consistent and predictable bandwidth use cases, use EBS-optimized or 10 Gigabit network connectivity instances and General Purpose (SSD) or Provisioned IOPS (SSD) volumes. Follow the guidance in the Amazon EC2 Instance Configuration topic to match the IOPS you have provisioned for your volumes to the bandwidth available from your instances for maximum performance. For RAID configurations, many administrators find that arrays larger than 8 volumes have diminished performance returns due to increased I/O overhead; test your individual application performance and tune it as required.
For increased capacity use cases, you can attach many more volumes, but attaching more than 40 volumes (this quantity is only possible on Linux instances) might result in boot failures. If you experience boot problems on an instance with many volumes attached, you can stop the instance, detach the non-essential boot volumes, and then reattach them after the instance is running.