Amazon Elastic Compute Cloud
User Guide for Linux (API Version 2014-10-01)
Did this page help you?  Yes | No |  Tell us about it...
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.

Attaching an Amazon EBS Volume to an Instance

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

  1. Open the Amazon EC2 console.

  2. Click Volumes in the navigation pane.

  3. Select a volume and then click Attach Volume.

  4. 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.

  5. 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.

  6. Click Attach to attach the volume to the instance. The volume and instance must be in the same Availability Zone.


    Volumes that have been mounted using the mount command are lost after restarting. To mount this Amazon EBS volume on every system reboot, add an entry for the device to the /etc/fstab file. For more information, see Making an Amazon EBS Volume Available for Use.

If a volume has an AWS Marketplace product code:

  • The volume can only be attached to 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.

Device Naming

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 TypeAvailableReserved for RootUsed for Instance Store VolumesRecommended for EBS Volumes













Differs by AMI

/dev/sda1 or /dev/xvda


/dev/sd[b-y] (hs1.8xlarge)



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/xvdh or /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/sdb would become /dev/xvdf and /dev/sdc would become /dev/xvdg. Amazon Linux AMIs create a symbolic link with the name you specify at launch that points to the renamed device path, but other AMIs might behave differently.

You cannot attach volumes that share the same device letters both with and without trailing digits. For example, if you attach a volume as /dev/sdc and another volume as /dev/sdc1, only /dev/sdc is 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 /dev/sdc1, /dev/sdc2, /dev/sdc3).

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] or /dev/sd[f-p][1-6]. If you're having trouble using /dev/sd[q-z] or /dev/sd[q-z][1-6], try switching to /dev/sd[f-p] or /dev/sd[f-p][1-6].

Volume Limits

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.

Bandwidth vs 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 any volumes that are non-essential to the boot process, and then reattach them after the instance is running.