Skip to content

How do I attach an Amazon EBS volume to an Amazon EC2 Windows instance?

3 minute read
0

I want to attach a new or existing Amazon Elastic Block Store (Amazon EBS) volume to an Amazon Elastic Compute Cloud (Amazon EC2) Windows instance.

Resolution

Prerequisites: Make sure that you adhere to the requirements to attach an EBS volume to an EC2 instance. To attach your volume as a root volume, you must first stop the instance.

Configure your instance for a stop and start

Note: When you stop and start an instance, the instance's public IP address changes. It's a best practice to use an Elastic IP address to route external traffic to your instance instead of a public IP address. If you use Amazon Route 53, then you might need to update the Route 53 DNS records when the public IP address changes. A stop and start is different from an instance reboot. For more information, see How EC2 instance stop and start works.

Before you stop and start your instance, take the following actions:

Attach the volume

Complete the following steps:

  1. (Root volumes only) Stop your instance.
  2. (Root volumes only) Detach the existing root volume.
  3. Attach the volume to the instance. To attach the volume as a root volume, enter /dev/sda1 for Device name. To attach an additional volume to the instance, use an available device name. For instances that are built on the AWS Nitro System, see Map Amazon EBS volumes to NVMe device names.
    Note: You can use a device name for a volume only once. You can't use duplicate device names in Amazon EC2. If you use a duplicate device name, then the operation fails and you receive the following error message:
    "Invalid value '/dev/abc' for unixDevice. Attachment point /dev/abc is already in use."
  4. Use Remote Desktop Protocol (RDP) to connect to your instance.
  5. Choose the Start menu, and then open Disk Management.
  6. Open the context (right-click) menu for the disk that's set to Offline, and then select Online. If the new empty volume and disk has the "Not Initialized" status, then make the EBS volume available to use on Windows.

Related information

Why isn't my EBS volume increase reflected in my OS or Disk Management?

Best practices for Amazon EC2

AWS OFFICIALUpdated 5 months ago