Attach an Amazon EBS volume to an instance
You can attach an available EBS volume to one or more of your instances that is in the same Availability Zone as the volume.
For information about adding EBS volumes to your instance at launch, see Instance block device mapping.
Prerequisites
-
Determine how many volumes that you can attach to your instance. For more information, see Instance volume limits.
-
If a volume is encrypted, you can attach it only to an instance that supports Amazon EBS encryption. For more information, see Supported instance types.
-
If a volume has an Amazon Web Services Marketplace product code:
-
You can attach a volume only to a stopped instance.
-
You must be subscribed to the Amazon Web Services Marketplace code that is on the volume.
-
The instance's configuration, such as its type and operating system, must support that specific Amazon Web Services Marketplace code. For example, you cannot take a volume from a Windows instance and attach it to a Linux instance.
-
Amazon Web Services Marketplace product codes are copied from the volume to the instance.
-
Important
If you attach an io2
volume to an instance that supports Block Express,
the volume always runs on Block Express. For more information, see io2
Block Express volumes.
You can attach a volume to an instance using one of the following methods.
Note
In some situations, you may find that a volume other than the volume attached to
/dev/xvda
or /dev/sda
has become the root volume of your
instance. This can happen when you have attached the root volume of another instance, or a
volume created from the snapshot of a root volume, to an instance with an existing root
volume. For more information, see Boot from the wrong
volume.