ECS disks cannot be shrunk after creation. Use Server Migration Center (SMC) to migrate data to a smaller disk, or manually create a smaller disk and copy the data.
-
Shrinking a disk involves factors such as data security, business continuity, and costs. Plan the process based on your business requirements.
-
Shrinking a disk attached to an instance may require an instance stop and restart, which interrupts workloads. Perform the operations during off-peak hours.
Prerequisites
Create snapshots to back up disk data. See Manually create a single snapshot.
Snapshots incur fees. See Billing of snapshots.
Shrink disks with SMC
SMC migrates data from a source disk to a custom image or another ECS instance with the required disk capacity. The source and destination instances can belong to the same or different Alibaba Cloud accounts. See Migrating ECS instances: cross-account and same-account.
This method applies to both system disks and data disks.
Considerations
-
SMC creates a pay-as-you-go intermediate instance during migration. You are charged for this instance.
NoteOn success, the intermediate instance is automatically released. On failure, the instance and migration task persist and billing continues. Manually release the instance to avoid unnecessary fees. See Clean up resources.
-
After migration, the instance ID and IP address change. Update IP address configurations in your business accordingly. See Migration impacts.
Procedure
Linux
-
Prepare the source ECS instance for migration. See Before you begin.
-
Import the Linux instance whose disks you want to shrink as a migration source to SMC.
Select Alibaba Cloud ECS instance as Migration Source Type. See Step 1: Import source.
-
Create and start a migration job.
When you create a migration job, note the following parameters:
-
Destination Type: Select ECS Image.
-
In the Modify Disk Partition section, the destination disk partition type defaults to the source disk type. Adjust destination disk size as needed.

-
Turn off Block Replication.
You can change the partition size only if block replication is disabled.
-
Change the disk and partition sizes. The destination disk must be larger than the used capacity of the source disk and the total size of all partitions.
For example, if the source disk is 50 GiB and the target size is 40 GiB, adjust the partition size accordingly.
-
-
-
After migration, a custom image is generated. In the Actions column of the migration job, click Create Instance to go to the ECS instance buy page.
-
The custom image is automatically filled in.
-
The default system disk category and size may differ from the source disk. Adjust as needed.
-
For other parameters, see Create from custom image or shared image.
-
Windows
-
On the source Windows instance, use Disk Management to shrink the volume to the desired capacity.
On Windows, block replication is automatically enabled and cannot be disabled. You must compress volumes before migration. See Steps 1 through 5 in Repartition a Windows disk by shrinking a volume.
For example, if disk C has one 40 GB partition, it can be compressed into an allocated partition of 20.47 GB and an unallocated space of 19.53 GB.

-
Complete the migration preparations for the source ECS instance. See Before you begin.
-
Import the Windows instance whose disks you want to shrink as a migration source to SMC.
Select Alibaba Cloud ECS instance as Migration Source Type. See Step 1: Import source.
-
Create and start a migration job.
When you create a migration job, note the following parameters:
-
Destination Type: Select ECS Image.
-
In the Modify Disk Partition section, the destination disk partition type is automatically set to the source disk type. Specify the destination disk size as needed.
NoteThe disk capacity must exceed the total partition size. Because you compressed the partition on the source disk, adjust the destination disk size accordingly.
For example, set the destination disk to 30 GiB if the source disk is 40 GiB.

-
-
After migration, a custom image is generated. In the Actions column of the migration job, click Create Instance to go to the ECS instance buy page.
-
The custom image is automatically filled in.
-
The default system disk category and size may differ from the source disk. Adjust as needed.
-
For other parameters, see Create from custom image or shared image.
-
Shrink a data disk manually
This method applies only to data disks.
-
System disks are created with instances and cannot be separately created or released. To shrink a system disk, use SMC.
-
Data disks can be shrunk by creating a new, smaller data disk, attaching it to the instance, and copying data from the original disk.
ImportantIf the data disk has dependencies on the system disk, this operation may interrupt your business. Perform the operation during off-peak hours.
Steps:
-
Create a data disk with the desired size.
-
Attach the new data disk to the instance and initialize it.
-
Copy data from the source data disk to the new data disk.
After replication, verify data integrity and correctness on the new disk.
-
Update application configurations. If your applications reference the original disk's drive letter or mount path, update them to point to the new disk.
-
Detach and release the source data disk to avoid unnecessary costs.
-