Menu
Amazon Elastic Compute Cloud
User Guide for Microsoft Windows Instances

Expanding the Storage Space of an EBS Volume on Windows

You can increase the storage space of an existing EBS volume without losing the data on the volume. To do this, you migrate your data to a larger volume and then extend the file system on the volume to recognize the newly-available space. After you verify that your new volume is working properly, you can delete the old volume.

If you need to expand the storage space of a volume on a Linux instance, see Expanding the Storage Space of a Volume in the Amazon EC2 User Guide for Linux Instances.

If you create a larger volume, you will be charged for the additional storage. For more information, see the Amazon Elastic Block Store section on the Amazon EC2 Pricing page.

Note

If your storage needs demand a larger EBS volume than AWS provides, you may want to use RAID 0 to "stripe" a single logical volume across multiple physical volumes. For more information see RAID Configuration on Windows.

Migrating Your Data to a Larger Volume

You must stop your instance to expand the storage space. When you stop and start an instance, be aware of the following:

  • Any data on any instance store volumes is erased. Therefore, if you have any data on instance store volumes that you want to keep, back it up to persistent storage.

  • If your instance is running in a VPC and has a public IP address, we release the address and give it a new public IP address. The instance retains its private IP addresses and any Elastic IP addresses.

  • If your instance is running in EC2-Classic, we give it new public and private IP addresses, and disassociate any Elastic IP address that's associated with the instance. You must re-associate any Elastic IP address after you restart your instance.

  • If your instance is in an Auto Scaling group, the Auto Scaling service marks the stopped instance as unhealthy, and may terminate it and launch a replacement instance. To prevent this, you can temporarily suspend the Auto Scaling processes for the group. For more information, see Suspend and Resume Auto Scaling Processes in the Auto Scaling User Guide.

To migrate your data to a larger volume

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose Instances and then locate the instance with the volume that you want to expand.

  3. Make a note of the instance ID and Availability Zone. You will specify this information when you attach a new volume to the instance later in this topic.

  4. Verify that the instance Shutdown Behavior is set to Stop and not Terminate.

    1. Choose the instance.

    2. From the context-menu (right-click) choose Instance Settings, and then choose Change Shutdown Behavior.

    3. If the Shutdown behavior is set to Terminate, choose Stop, and then choose Apply.

      If the Shutdown behavior is already set to Stop, then choose Cancel.

  5. Stop the instance. For more information about how to stop an instance, see Stopping and Starting Your Instances.

    Warning

    When you stop an instance, the data on any instance store volumes is erased. Therefore, if you have any data on instance store volumes that you want to keep, be sure to back it up to persistent storage.

  6. Create a snapshot of the volume to expand.

    1. In the navigation pane, choose Volumes, and then locate the volume you want to expand.

    2. From the context-menu (right-click) choose the volume that you want to expand, and then choose Create Snapshot.

    3. Enter information in the Name and Description fields, and then choose Yes, Create.

  7. Create a new volume from the snapshot.

    1. In the navigation pane, choose Snapshots.

    2. When the status of the snapshot that you just created is set to completed, choose the snapshot, and then from the context-menu (right-click) choose Create Volume.

    3. In the Create Volume dialog box, choose the desired volume type and enter the new volume size. You must also set the Availability Zone to match the instance Availability Zone. Choose Yes, Create.

      Important

      If you do not set the Availability Zone to match the instance then you will not be able to attach the new volume to the instance.

  8. Detach the old volume.

    1. In the navigation pane, choose Volumes, and then choose the old volume from the list. Make a note of the device name in the Attachment Information column:

      i-xxxxxxxxxxxxxxxxx (instance_name):device_name
    2. From the context-menu (right-click) choose the old volume, and then choose Detach Volume.

    3. In the Detach Volume dialog box, choose Yes, Detach. It may take several minutes for the volume to detach.

  9. Attach the newly expanded volume

    1. In the navigation pane, choose Volumes.

    2. From the context-menu (right-click) choose the new volume, and then choose Attach Volume.

    3. Start typing the name or ID of the instance in the Instance field, and then choose the instance.

    4. Enter the same device name retrieved in Step 8.a, and then choose Yes, Attach. It is important to note that the volume needs to be reattached to the exact location it was detached from (for example /dev/sda1).

  10. Restart the instance.

    1. In the navigation pane, choose Instances and then choose the instance you want to restart.

    2. From the context-menu (right-click) choose Instance State, and then choose Start.

    3. In the Start Instances dialog box, choose Yes, Start. If the instance fails to start, and the volume being expanded is a root volume, verify that you attached the expanded volume using the same device name as the original volume, for example /dev/sda1.

After the instance has started, you can check the file system size to see if your instance recognizes the larger volume space.

If the size does not reflect your newly-expanded volume, you must extend the file system of your device so that your instance can use the new space. For more information, see Extending a Windows File System.

Extending a Windows File System

In Windows, you use the Disk Management utility to extend the disk size to the new size of the volume.

To extend a Windows file system

  1. Log in to your Windows instance using Remote Desktop.

  2. Open the Disk Management utility.

    • On the Windows Server 2012 Start screen, type disk management and choose Create and format hard disk partitions in the Search pane.

    • On Windows Server 2008 type diskmgmt.msc in the Run dialog and press Enter.

    Windows Server Disk Management Utility
  3. Right-click the expanded drive and select Extend Volume.

    Windows Server Disk Management Utility
  4. In the Extend Volume Wizard, choose Next, then set the Select the amount of space in MB field to the number of megabytes by which to extend the volume. Normally, you set this to the maximum available space. Note that the highlighted text under Selected is the amount of space that will be added, not the final size the volume will have.

    Complete the wizard.

    Windows Server Extend Volume Wizard

Deleting the Old Volume

After the new volume has been attached and extended in the instance, you can delete the old volume if it is no longer needed.

To delete the old volume

  1. In the Amazon EC2 console, choose Volumes in the navigation pane and then choose the volume you want to delete.

  2. From the context-menu (right-click) choose Delete Volume.

  3. In the Delete Volume dialog box, choose Yes, Delete.