Skip to content

Why can't I extend my Amazon EBS volume?

6 minute read
0

I can't extend my Amazon Elastic Block Store (Amazon EBS) volume of my Amazon Elastic Compute Cloud (Amazon EC2) Windows instance.

Short description

After you increase the size of an EBS volume, you must also expand the file system at the operating system (OS) level. If the Extend Volume option in Disk Management is unavailable (greyed out), then you can't extend the file system.

This issue occurs for the following reasons:

  • You didn't scan the volume for unallocated space.
  • A recovery partition exists between the unallocated space and the volume that you want to extend.
  • The volume uses the Master Boot Record (MBR) partition style that's 2 TB in size.
    Note: Volumes that use MBR can't exceed 2 TB. For more information, see Windows partition on the Microsoft website.
  • Your AWS driver versions are outdated.

Resolution

Prerequisite: To restore your configuration if you encounter issues, create an Amazon Machine Image (AMI) of your Amazon EC2 instance. Or, create a snapshot of the EBS volumes of your EC2 instance.

Scan the volume for unallocated space in Disk Management

Complete the following steps:

  1. Check the volume to verify that it's in the Available state.
    Note: If your volume's modification state is stuck in Optimizing, then see Why is my Amazon EBS volume stuck in the optimizing state when I modify the volume?
  2. Use Remote Desktop Protocol (RDP) to connect to your Windows EC2 instance.
  3. Choose the Start menu, and then open Disk Management.
  4. Choose Action, then select Rescan Disks.

In Disk Management, you can see the disk drives and their partitions. The unallocated space on a disk drive has the Unallocated label. If the unallocated space doesn't appear after you rescan, then wait a few minutes and scan again.

Remove the recovery partition that blocks your volume extension

If a recovery partition exists between your volume and the unallocated space, then you can't extend the volume. Volumes require continuous disk space.

Delete the recovery partition

Complete the following steps:

  1. Open Command Prompt as an administrator.

  2. Run the following command as an administrator to deactivate Windows Recovery Environment:

    reagentc /disable

    Note: You must deactivate Windows Recovery Environment to delete the recovery partition.

  3. Run the following command as an administrator to manage your computer's disks:

    diskpart
  4. Run the following commands to list all disks:

    list disk
  5. Run the following command to select the disk that contains the recovery partition:

    select disk disknumber

    Note: Replace disknumber with the number of the disk that has the recovery partition.

  6. Run the following command to list all partitions on the disk:

    list partition
  7. In the command output, identify the recovery partition. The partition typically appears as a small partition between your main volume and the unallocated space. Run the following command to select the partition:

    select partition partitionnumber

    Note: Replace partitionnumber with the recovery partition number.

  8. Run the following command to delete the recovery partition:

    delete partition override
  9. Run the following command to exit diskpart:

    Exit

Extend the volume

Complete the following steps:

  1. Choose the Start menu, and then open Disk Management.
  2. Choose Action, then choose Rescan Disks.
  3. Open the context (right-click) menu for your volume, and then choose Extend Volume.
  4. In the Extend Volume wizard, choose Next.
  5. For Select the amount of space in MB, enter the increase in volume size.
    Note: It's best practice to enter the maximum available space. The highlighted text under Selected shows the amount of space that you added, not the final size of the volume.
  6. Complete the fields in the wizard.

It's not a best practice to recreate the recovery partition on EC2 instances. By default, Windows AMIs don't include a recovery partition. If you recreate the recovery partition, then the instance might become unreachable. If Windows Recovery Environment activates during boot, then there's no console access to interact with it. To recover your instance, use the AMI or EBS snapshot that you created instead.

Use GPT instead of MBR to extend beyond 2 TB

AMIs have a boot mode parameter that determine how the instance boots. You set the partition style to either MBR or GUID Partition Table (GPT) when you create the volume. To extend boot and non-boot volumes beyond 2 TB, the disk must use the GPT partition style. With GPT, you can extend the volume up to 64 TB. For more information, see Windows support for hard disks that are larger than 2 TB on the Microsoft website and Service limitations.

Extend a boot volume to more than 2 TB

Prerequisite: Your instance type must support the Unified Extensible Firmware Interface (UEFI) boot mode.

Use the MBR2GPT tool to convert the volume from the MBR to the GPT style without data loss. You can use the tool in Windows 10 version 1703 and later, and Windows Server 2016 and later. For more information, see MBR2GPT.EXE on the Microsoft website.

Extend the non-boot volume to more than 2 TB

Complete the following steps:

  1. Create an empty volume in the same Availability Zone as the instance.
  2. Attach the new volume to your instance.
  3. Use RDP to connect to your instance.
  4. Initialize the new GPT disk. For instructions, see Initialize a new disk on the Microsoft website.
    Note: For Use the following partition style for the selected disks, choose GPT. For volume, keep the default size.
  5. Use robocopy to copy the data from the original volume to the new volume. For more information, see robocopy on the Microsoft website.
  6. Unmount and detach the volume from the instance.
  7. Reboot the instance to verify that the instance works as expected.
  8. Delete the detached volume.

Upgrade your AWS drivers

Outdated drivers can cause volume recognition and performance issues when you extend your volume. To resolve driver issues, upgrade your AWS drivers.

Related information

How do I increase the EBS root volume of my EC2 Windows instance?

Make an Amazon EBS volume available for use

Extend a basic or dynamic volume on the Microsoft website