|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
This section describes how to attach an Amazon EBS volume that you created to an instance.
To attach an Amazon EBS volume to an instance using the console
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
Click Volumes in the navigation pane.
The console displays a list of current volumes.
Select a volume and click Attach Volume.
The Attach Volume dialog box appears.
In the Instance box, start typing the name or ID of the instance to attach the volume to, and select it from the list of suggestion options (only instances in the same Availability Zone as the volume are displayed). Encrypted volumes may 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 on 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.
|Instance Type||Possible for Connection||Reserved for Root||Instance Store Volumes||Recommended for EBS Connection|
Linux / Unix (paravirtual)
|Linux / Unix (HVM)||
Differs by AMI
/dev/sda1 or /dev/xvda
/dev/sd[b-y] (for hs1.8xlarge instances)
xvdc[a-x] (for hs1.8xlarge instances)
xvd[f-p] (with Red Hat PV drivers)
xvd[f-z] (with Citrix PV drivers)
Depending on the block device driver of your instance's kernel, the device may
be attached with a different name than what you specify. For example, if you specify
a device name of
/dev/sdh, your device may 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 may
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 may 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
be visible to the instance. If you wish use trailing digits in device names, you must use
trailing digits on all device names that share the same base letters (such as
For Linux/Unix instance types, we've received reports that 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
Hardware virtual machine (HVM) AMIs (such as Windows and Cluster Compute images) do
not support the use of trailing numbers on device names
xvd[a-p][1-15]). You can view the virtualization type of your instance
on the Virtualization field of the instance's details pane.
Depending on the size of your instance, Amazon EC2 provides instance store volumes on
/dev/sd[b-e] (on Linux/Unix) or
Although you can connect your Amazon EBS volumes using these device names, we highly recommend
that you don't because the behavior can be unpredictable.
Amazon EC2 Windows AMIs come with an additional service installed, the Ec2Config
Service. The Ec2Config service runs as a local system and performs various
functions to prepare an instance when it first boots up. After the devices have been mapped
with the drives, the Ec2Config service then initializes and mounts the drives. The root
drive is initialized and mounted as
c:\. The instance store volumes that come
attached to the instance are initialized and mounted as
and so on. By default, when an Amazon EBS volume is attached to a Windows instance, it may show
up as any drive letter on the instance. You can change the settings of the Ec2Config service
to set the drive letters of the Amazon EBS volumes per your specifications. For more information,
see Using Ec2Config in the
Amazon Elastic Compute Cloud Microsoft Windows Guide.
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 your desired effect is increased I/O bandwidth or increased storage capacity.
Windows instances use either Red Hat or Citrix paravirtual (PV) drivers for storage I/O, and each driver type has its own upper limit for volume attachment. If your Windows instance is using Citrix PV drivers, you can attach up to a total of 25 Amazon EBS volumes using the Amazon EC2 CLI; Windows instances with Red Hat PV drivers are limited to 16 volumes. To determine which paravirtual drivers your instance is using or to upgrade your Windows instance from Red Hat to Citrix paravirtual drivers, see Upgrading Your PV Drivers on Your Windows AMI.
Although it is technically possible to attach more than 25 volumes to a Windows instance with Citrix PV drivers, this is likely to cause performance issues and is not recommended.
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; see Windows-specific Volume Limits for Windows instances) may 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.