After you extend partitions and file systems of a system disk or data disk of a Windows Elastic Compute Service (ECS) instance, you must continue extending the partitions and file systems of the disk on the instance. This topic describes how to extend the incremental storage capacity of a Windows instance into an existing or added partition.
Preparations
The instance to which the disk that you want to resize is attached meets the following requirements:
The instance is in the Running state.
The instance does not run a Windows Server 2003 image.
The version of the Red Hat virtio driver is 58011 or later. For more information, see Update Red Hat virtio drivers of Windows instances.
The disk is in the In Use (In_use) state.
The disk was resized in the ECS console. For information about how to resize a disk, see Step 1: Resize a disk to extend the disk capacity.
NoteIf you set the Resizing Method parameter to Offline Resizing to resize a disk that is attached to an ECS instance, you must restart the instance in the ECS console or by calling an API operation after you resize the disk to make the new disk size take effect. If you restart Windows operating system on the instance, the new disk size does not take effect. For more information, see Restart an instance.
Preparations
(Recommended) Create a snapshot for the disk whose partitions and file systems you want to extend to back up disk data. For more information, see Create a snapshot.
NoteIn most cases, data loss does not occur when you extend partitions and file systems. To prevent data loss or exceptions caused by accidental operations, we recommend that you create snapshots to back up disk data.
You must be familiar with the process for resizing a disk. For more information, see Overview.
Procedure
In this example, a disk is extended from 40 GB to 60 GB on an ECS instance that runs the Windows Server 2016 64-bit public image. The actual operations vary based on the disk and image that you use.
Step 1: Check whether the partitions of the disk require to be converted
If the disk does not exceed 2 TiB in size or uses GUID Partition Table (GPT) partitions, skip this step.
If the disk is larger than 2 TiB in size and uses Master Boot Record (MBR) partitions, convert the partitions to GPT partitions before you extend the partitions and file systems of the disk. For more information, see Convert a data disk on a Windows instance from MBR to GPT and Step 2: Extend partitions and file systems.
Step 2: Extend partitions and file systems
Extend an existing partition and file system
This section describes how to add 20 GiB of incremental storage capacity to an existing partition. In this example, the system disk C drive is used.
Connect to the ECS instance.
Log on to the ECS console. In the left-side navigation pane, click Instances. On the Instance page, select the instance to which you want to connect and click Connect in the Actions column. For more information, see Use Workbench to connect to a Windows instance over RDP.
Check the virtio driver version of the Windows instance. If you want to resize a disk online, make sure that the version of your virtio driver is 58011 or later. Otherwise, you must restart the instance to allow the system to recognize the unallocated space. Open the Run dialog box. Enter powershell and click OK to start PowerShell. Run the following command to check the virtio driver version:
[System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Windows\System32\drivers\viostor.sys")
The following command output is returned.
Update the virtio driver if the number at the end of the ProductVersion value is less than
58011
. For more information, see Update Red Hat virtio drivers of Windows instances.On the Windows desktop, right-click the
icon and select Disk Management.
In the Disk Management dialog box, choose to view the unallocated disk capacity.
The following figure shows that Disk 0 (C:) is the system disk and Disk 1 (D:) is a data disk.
Right-click the blank space in the disk section and select Extend Volume... In this example, the blank space in the Disk 0 section is clicked.
ImportantThe Windows operating system does not allow disks to be resized across partitions. For a disk that has multiple partitions, the incremental storage capacity can be allocated only to the left adjacent partition on a disk that has multiple partitions.
For example, the space of disk 1 cannot be directly allocated to disk 0. The partitions and file systems of different disks are independent from each other. The extended space can be used only to extend the partition of the current disk or create a new partition.
Follow the instructions in the Extend Volume Wizard dialog box to extend the volume.
After you extend the partition, the incremental storage capacity is automatically added to the C drive. The following figure shows that the C drive has 60 GB of available capacity.
Create an additional partition
This section describes how to create an additional partition to which 20 GB of incremental storage capacity is allocated. In this example, the E drive is created.
Connect to the ECS instance.
Log on to the ECS console. In the left-side navigation pane, click Instances. On the Instance page, select the instance to which you want to connect and click Connect in the Actions column. For more information, see Use Workbench to connect to a Windows instance over RDP.
Check the virtio driver version of the Windows instance. To resize a disk online, make sure that the version of your virtio driver is 58011 or later. Otherwise, you may be unable to identify the unallocated space online. Open the Run dialog box, enter powershell, and then click OK to start PowerShell. Run the following command to check the virtio driver version:
[System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Windows\System32\drivers\viostor.sys")
The following command output is returned.
Update the virtio driver if the number at the end of the ProductVersion value is less than
58011
. For more information, see Update Red Hat virtio drivers of Windows instances.In the Disk Management dialog box, choose to view the unallocated disk capacity.
The following figure shows that Disk 0 (C:) is the system disk and Disk 1 (D:) is a data disk.
Right-click the blank space in the Disk 1 section and select New Simple Volume...
Follow the instructions in New Simple Volume Wizard to extend the volume.
The following figure shows that the E drive has 20 GB of available capacity after you create the drive to allocate the incremental storage capacity.
After you extend partitions or file systems, you must check whether the partition or file system sizes are the same as the specified values and whether business on the ECS instance runs as expected.