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

2 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: You must meet all the prerequisites to attach an Amazon EBS volume to an instance.

To attach an EBS volume as a root volume of an EC2 Windows instance, complete the following steps:

  1. Verify that your instance is in the Stopped state.
  2. Detach the existing root volume.
  3. Use the Amazon EC2 console or the AWS Command Line Interface (AWS CLI) to attach the EBS volume to the EC2 Windows instance. For device name, use /dev/sda1.
    Note: If you receive errors when you run AWS CLI commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.
  4. To connect to your EC2 Windows instance, use Remote Desktop Protocol (RDP) .

To attach an additional volume to an instance and make the volume available to Windows, complete the following steps:

  1. Attach the EBS volume to the Windows instance and use an available device name. For Nitro-based instances, see Amazon EBS volumes and NVMe.
  2. To connect to your EC2 instance, use RDP .
  3. Make the EBS volume available to use on Windows. You can use Windows PowerShell, the DiskPart command interpreter, or Disk Management to access the volume.

Note: When you use a device name to attach a volume to an instance, don't use that device name again. Amazon EC2 doesn't allow you to use duplicate device names. If you use duplicate device names, then the operation fails with the following error:

"Invalid value '/dev/abc' for unixDevice. Attachment point /dev/abc is already in use."

For more information, see Available device names.

Related information

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

Best practices for Amazon EC2

AWS OFFICIAL
AWS OFFICIALUpdated 4 months ago