Expanding Cloud Disks

Last Updated At: 2025-10-21 09:10:00

Scenarios

A cloud disk is an expandable storage device on cloud. You can expand its capacity at any time without losing any data in it.
After the cloud disk capacity is expanded, you need to extend the partition and file system. You can allocate expanded capacity to an existing partition or format the expanded capacity into a new independent partition.

Note:

MBR partition supports a disk with a maximum capacity of 2 TB. If you need to extend for over 2 TB, we recommend you create and attach a new data disk and use the GPT partition format.

Operation limits

  1. The cloud disks only support expanding and do not support shrinking.
  2. Only cloud disks with normal lifecycle support expanding, and isolated cloud disks do not support expanding.

Expanding Data Disks

Note:

If multiple cloud disks of the same capacity and type are mounted to your CVM, you can identify them by seeing the operations shown in Distinguishing data disks. Select a data disk and expand it as instructed below.

Expanding via the CVM Console

  1. Log in to the CVM console.
  2. Select More > CVM Configuration > Adjust Disk in the row of the target CVM.
  3. Select the required new capacity size (must be greater than the current capacity).
  4. Depending on the operating system type of the target cloud service, you need to execute Expanding partitions and file system (Windows) or Expanding partition and file system (Linux) to allocate the capacity of the expanded part to the existing partition or format the capacity of the expanded part into a separate new partition.

Expanding via the CBS Console

  1. Log in to the CBS console.
  2. Select More > Expansion on the target CBS.
  3. Select the required new capacity size (must be greater than the current capacity).
  4. Depending on the operating system type of the target cloud service, you need to execute Expanding partition and file system (Windows) or Expanding partition and file system (Linux) to allocate the capacity of the expanded part to the existing partition or format the capacity of the expanded part into a new independent partition.

Expanding via the API

You can use the ResizeDisks API to expand the specified elastic cloud disks.

Expanding System Disks

Expanding via the CVM Console

  1. Log in to the CVM console.
  2. Select More > CVM Configuration > Adjust Disk in the row of the target CVM.
  3. Select the required new capacity size (must be greater than the current capacity).
  4. After the console expansion is completed, log in to the instance to confirm whether the file system has been automatically expanded.

Expanding via the CBS Console

  1. Log in to the CBS console.
  2. Select More > Expansion on the target CBS.
  3. Select the required new capacity size (must be greater than the current capacity).
  4. After the console expansion is completed, log in to the instance to confirm whether the file system has been automatically expanded.

Expanding via API

You can use the ResizeInstanceDisks API to expand the capacity of specified non-elastic cloud disks.

Related Operations

Distinguishing Data Disks

Check cloud disks according to the operating system of the CVM, and select your way:

Linux

  1. Log in to a Linux instance.

  2. Execute the following command to check the corresponding relationship between cloud disks and device names.

    ls -l /dev/disk/by-id
    

    The returned result is as shown in the following figure:

    In which, disk-xxxx is the ID of cloud disks. You can check it in the cloud disks console.

Windows

  1. Log in to a Windows instance.

  2. Right-click 87d894e564b7e837d9f478298cf2e292.png (28×27), and select Run.

  3. Enter cmd in the popup window and press Enter.

  4. Run the following command to check the corresponding relationship between cloud disks and device names.

    wmic diskdrive get caption,deviceid,serialnumber
    

    Or execute the following command:

    
    wmic path win32_physicalmedia get SerialNumber,Tag
    

    The returned result is as shown in the following figure:

    In which, disk-xxxx is the ID of cloud disks. You can check it in the cloud disks console.

Checking the Cloudinit Configuration

Check cloud disks according to the operating system of the CVM, and select your way:

Checking the Cloudinit Configuration of Linux Instances

After the system disk is expanded, log in to the Linux instance and check whether the /etc/cloud/cloud.cfg file contains the growpart and resizefs configuration items.

  • Yes. If the system disk is expanded and online expansion cannot be performed, you need to restart the machine. During system startup, cloud-init will call the growpart/resizefs command to complete expansion. As shown below:

    • growpart: Expand the partition size to the disk size.
    • resizefs: Expand and adjust the size of / partition file system to the partition.
  • No. Manually expand the file system and partition according to the operating system type of the target cloud service. You need to execute Expanding partition and file system (Linux) to allocate the capacity of the expanded part to the existing partition or format the capacity of the expanded part as a new independent partition.

Checking the Cloudinit Configuration of Windows Instances

After the system disk is expanded, log in to the Windows instance and check whether the ExtendVolumesPlugin configuration item exists under plugin in C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf.

  • Yes. If the cloudbase-init configuration file cloudbase-init.conf contains the ExtendVolumesPlugin configuration item, you need to restart the machine cloudbase-init before automatically expanding the volume and adding the blank space behind partition C to partition C. And there should be no other partition interference between the C partition and the blank space. If there are no other partitions between the C partition and the blank space, and you do not want to restart, or a third-party security software intercepts cloudbase-init so that it cannot complete the extend volume, you need to manually implement the following powershell command.

    $DiskOps="@
    select disk 0
    select volume c
    extend
    exit
    @"
    $DiskOps | diskpart.exe | Out-Null
    
  • No. Manually expand the file system and partition according to the operating system type of the target cloud service. You need to execute Expanding partition and file system (Windows) to allocate the capacity of the expanded part to the existing partition or format the capacity of the expanded part as a new independent partition.