After you increase the capacity of a disk, you must extend its partitions and file systems to use the added space. Disks cannot be shrunk. Carefully evaluate your business capacity requirements before you proceed.
Step 1: Increase the disk capacity
Prerequisites
Ensure that one of the following conditions is met:
The disk is attached to an ECS instance that has not expired. The instance is in the Running or Stopped state.
The disk is in the Unattached state.
Procedure
Go to ECS console - Block Storage - Cloud Disks. In the top-left corner, select the region and resource group for the target resource.
In the Actions column of the target disk, click Resize.
We strongly recommend that you create a snapshot to back up disk data to prevent data loss from accidental operations during resizing. On the Determine Disk and Read Notes page, verify the information, click Create Snapshots, set a name and retention period for the snapshot, and then click Confirm.
ImportantSnapshots incur fees.

After the value in the Resizing Supported column changes to Yes, click I Understand Risks and Have Backed Up Data. Proceed.
The time required to create a snapshot depends on factors such as the data volume and network bandwidth. You can go to the ECS console - Snapshots page and view the progress in the Progress column of the target snapshot.
On the Configure Resizing Method and New Size page, configure the resizing parameters, confirm the fee, and then click OK.
ImportantYou are charged for the added capacity when you resize a disk.
Parameter
Description
New Disk Size
The capacity after resizing cannot be smaller than the current capacity.
Resizing Method
Online Resizing (Recommended): After you increase the capacity, you do not need to restart the instance. The new capacity takes effect immediately.
Offline Resizing: The disk is in the Unattached state, the instance is in the Stopped state, or some instance types support only offline resizing.
(Conditionally required) If you resize a Subscription disk, wait for the 5-second countdown in the payment dialog box to finish, click Complete Payment, then return to the resizing process and click Paid. Close the dialog box.
If you click Paid. Close the dialog box. before you complete the payment, you cannot continue the resizing process. You must click Pay for the order, complete the payment, and then return to the resizing process.
Step 2: Extend the partitions and file systems
Prerequisites
If the disk is in the Unattached state, attach it to an ECS instance.
If you performed an offline resizing on an attached disk, first restart or start the instance.
If the data disk does not have a file system, follow the instructions in Initialize a data disk.
Procedure
This section uses Windows Server 2022 as an example.
Determine whether you need to convert the partition style.
Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target resource.
Go to the details page of the target instance, click Connect, and select Workbench. Select Terminal Connection as the connection method, enter the username and password, and log on to the graphical terminal page.
On the Windows Server desktop, right-click the
icon and select Disk Management.In the Disk Management window, right-click the target disk and select Properties.

In the dialog box that appears, click the Volume tab to view the Disk Partition Style.
If the partition style is Master Boot Record (MBR) and the capacity after resizing is greater than 2 TiB, follow the instructions in Convert the partition style of a data disk to GPT and repartition the disk.
Extend the partition and file system.
Extend a partition
In the Disk Management dialog box, choose to view the unallocated disk capacity.
Right-click a blank area of the last partition of the disk and select Extend Volume.
Because partitions and file systems on a disk are independent, you can extend only the last partition on the same disk. In this example, you can add the unallocated space on Disk 1 only to New Volume (E:).

Follow the Extend Volume Wizard, accepting the default settings. The added capacity is then automatically merged into the last partition. You can check the data on the disk and verify that your applications work as expected.
Create a new partition
In the Disk Management dialog box, choose to view the unallocated disk capacity.
Right-click a blank area of the unallocated space and select New Simple Volume.

Follow the instructions in the New Simple Volume Wizard and use the default settings to complete the operation.
Billing
Increasing a disk's capacity incurs charges for the added space. The billing method for the added capacity is the same as that for the original disk.
Subscription disks: After you resize a subscription disk, you are immediately billed for the new capacity. You must pay the price difference between the old and new capacities for the remaining subscription duration.
Price difference = (Monthly price / 30) × Remaining duration in days × Added capacity.
The remaining duration is measured in days and is accurate to the second.
Pay-as-you-go disks: After you resize a pay-as-you-go disk, billing immediately starts for the new capacity. Bills are generated in the next hour for the usage in the current hour.
If you have purchased a Storage Capacity Unit (SCU), it can automatically offset the bills of your pay-as-you-go disks. For more information, see block storage billing.
References
If an error occurs during the resizing operation, you can use the snapshot that you created before resizing to roll back the disk. This restores the data on the disk to its pre-resizing state. The added capacity is not rolled back.
You cannot directly shrink a resized disk. To shrink a disk, you can use Server Migration Center (SMC).
To resize a disk for a Linux instance, see Resize a disk (Linux).
FAQ
FAQ about resizing disks
Why is the Proceed button grayed out?
Check whether a snapshot is being created for the disk. You cannot resize a disk while a snapshot is being created. Wait for the snapshot to be created, and then try to resize the disk again.
How to avoid restarting after offline resizing?
Offline resizing takes effect only after you restart the instance. If you cannot restart the instance but already selected offline resizing, you can perform an online resizing of 1 GiB to apply the capacity from both the previous offline and the new online resizing. This is a secondary resizing and incurs additional fees. Proceed with caution.
Instance types that support only offline resizing
ecs.ebmc4.8xlarge
ecs.ebmhfg5.2xlarge
ecs.ebmg5.24xlarge
ecs.t1
ecs.s1
ecs.s2
ecs.s3
ecs.c1
ecs.c2
ecs.m1
ecs.m2
How do I resize a disk by using an API?
We strongly recommend calling the CreateSnapshot API to back up disk data before you resize the disk.
You are charged for using snapshots.
ImportantBack up your data to prevent data loss from accidental operations during resizing.
After the snapshot is created, call the ResizeDisk API to increase the capacity of the disk.
After you increase the capacity of the disk, you must also extend its partitions and file systems.
Call the RunCommand API to send commands to the target instance.
Call the DescribeInvocations API to query the command output.
Commands
Determine whether you need to convert the partition style.
Get-DiskResponse parameter
Description
Number
The disk number.
Partition Style
The partition format of the disk.
If the
Partition Styleis MBR and the capacity after resizing is greater than 2 TiB, follow the instructions in Convert the partition style of a data disk to GPT and repartition the disk.Extend the partition and file system.
Extend a partition
Determine the drive letter of the partition that you want to extend.
<Number>is the disk number that you obtained in the previous step.Get-Partition -DiskNumber <Number>In the response, DriveLetter is the drive letter of the partition that you want to extend. If multiple partitions exist, you can extend only the last partition.
Extend the partition and file system.
<DriveLetter>is the drive letter that you obtained in the previous step.Resize-Partition -DriveLetter <DriveLetter> -Size (Get-PartitionSupportedSize -DriveLetter <DriveLetter>).sizeMaxCheck the result of the partition and file system extension.
Run
Get-Partition -DiskNumber <Number>and check theSizefield. If the partition size matches the expected size, the extension is successful.
Create a new partition
Check the partitions of the disk.
<Number>is the disk number that you obtained in the previous step.Get-Partition -DiskNumber <Number>In the response, DriveLetter is the drive letter of the existing partition.
Create a new partition.
Command parameter
Description
-DiskNumber
The disk number. Replace
<Number>with the disk number that you obtained in the first step.-UseMaximumSize
Indicates that the command uses the maximum available capacity.
-DriveLetter
Replace
<DriveLetter>with the drive letter for the new partition. The drive letter cannot be the same as the drive letter of an existing partition.New-Partition -DiskNumber <Number> -UseMaximumSize -DriveLetter <DriveLetter>Format the new partition.
Command parameter
Description
-DriveLetter
Replace
<DriveLetter>with the drive letter that you specified in the preceding step.-FileSystem
Replace
<FileSystem>with a file system type, such as NTFS.-Confirm:$false
Skips the confirmation prompt.
Format-Volume -DriveLetter <DriveLetter> -FileSystem <FileSystem> -Confirm:$falseView information about the new partition.
Run
Get-Partition -DiskNumber <Number>to view basic information about the new partition.
FAQ about extending partitions and file systems
Unallocated space not detected after rescan
For instances created before March 30, 2019, the virtio driver version may be earlier than 58011. You must restart the instance to recognize the added space. You can run the following command in PowerShell to check the driver version. If required, you can update the virtio driver for a Windows instance.
[System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Windows\System32\drivers\viostor.sys")Can disk capacity extend other disks?
Partitions and file systems on a disk are independent. You can extend only the last partition on the same disk. You cannot allocate the added capacity to another disk. Therefore, you cannot use the capacity of one data disk to extend another data disk or a system disk.
Error: Exceeding maximum cluster count
Cause: You did not correctly set the Allocation Unit Size when you initialized the disk. For more information about disk capacity limits, see NTFS overview.
For Allocation Unit Size:
To resize a disk to a capacity in the range of 16 TiB to 32 TiB (inclusive), make sure that the allocation unit size was set to 8192 during initialization.
To resize a disk to a capacity in the range of 32 TiB to 64 TiB (inclusive), make sure that the allocation unit size was set to 16K during initialization.
Solution:
ImportantAllocation Unit Size cannot be changed after the disk is initialized.
View the Allocation Unit Size of the disk to be resized.
Log on to the instance, open the PowerShell command-line interface, and run the following command to obtain the Allocation Unit Size. For example, to view drive D:
In the output result, Bytes Per Cluster or Bytes Per Cluster is the Allocation Unit Size.
fsutil fsinfo ntfsinfo D:Choose a solution based on your business requirements.
Create a new disk
Create a data disk of the target capacity for the current instance.
When you initialize the data disk, select the correct allocation unit size.
Manually copy the data from the original disk to the new disk.
Verify that your services are restored. After you complete the operation, restart the relevant services and check that they are running as expected.
After you confirm that your services are running as expected, you can detach the original data disk and then release it. For more information, see Detach a data disk and Release a disk.
Create a new partition
In the Disk Management dialog box, choose to view the unallocated disk capacity.
Right-click a blank area of the unallocated space and select New Simple Volume.

Follow the instructions in the New Simple Volume Wizard and use the default settings to complete the operation.
API commands for partition conversion
ImportantDuring the conversion, the data on the disk is unavailable, which may affect your services. We recommend that you plan a downtime window. Stop your services before you start the conversion. After the conversion and data restoration are complete, resume your services.
Step 1: Convert partition and repartition
During partition conversion in Windows, you must delete the volume. Deleting a volume erases all data on it. Before you convert the partition, call the CreateSnapshot API to create a snapshot that backs up the data on the disk. After you convert the partition, you must restore the data from the snapshot.
Call the RunCommand API to send commands to the target instance.
Call the DescribeInvocations API to query the command output.
Commands
Convert the partition format.
Obtain the disk number (Number) and total capacity (Total Size) of the target disk.
Get-DiskDetermine the partition number (PartitionNumber) of the target disk.
<Number>is the disk number that you obtained in the preceding step.Get-Partition -DiskNumber <Number>Delete the partition on the target disk.
ImportantThe Delete Volume operation permanently erases all data from the volume. Before you delete the volume, make sure to call the CreateSnapshot API to back up the data.
Command parameter
Description
-DiskNumber
<Number> is the disk number that you obtained in the first step.
-PartitionNumber
<PartitionNumber> is the partition number that you obtained in the preceding step.
-Confirm:$false
Skips the confirmation prompt.
Remove-Partition -DiskNumber <Number> -PartitionNumber <PartitionNumber> -Confirm:$falseAfter you delete all partitions on the target disk, convert the partition style.
Enter the diskpart tool.
diskpartList information about all disks.
list diskSelect the disk to convert.
<Number> is the disk number that you obtained in the first step.
select disk <Number>Convert the partition style to GPT.
convert gptExit the diskpart tool.
exit
Check whether the conversion is successful.
Run the
Get-Diskcommand. If the value ofPartition Stylefor the target disk is GPT, the conversion was successful.
Repartition the disk.
Repartition the disk.
Command parameter
Description
-DiskNumber
<Number> is the disk number that you obtained in the first step.
-Size
<Size> specifies the custom size of the new partition, such as 40 GB.
-DriveLetter
<DriveLetter> specifies the custom drive letter of the new partition.
-FileSystem
<FileSystem> specifies the file system type of the new partition, such as NTFS.
New-Partition -DiskNumber <Number> -Size <Size> -DriveLetter <DriveLetter> | Format-Volume -FileSystem <FileSystem>Run
Get-Partition -DiskNumber <Number>to view information about the new partition.
Step 2: Restore disk data
Call the CreateDisk API to create a data disk from the snapshot.
Call the AttachDisk API to attach the created data disk to the ECS instance to copy data. Do not roll back the disk by using the snapshot. Otherwise, rolling back the disk may revert it to the MBR format.