You can resize disks to meet your storage requirements as your business and application data grow. This topic describes the maximum sizes that disks can be extended to and how to resize a disk.

Scenarios

You can increase the storage capacity of an instance in one of the following methods:

  • Resize a disk. To this end, you must resize the existing partitions of the disk or create new partitions for the disk.
    You can use one of the following methods to resize a disk.
    Resizing method Prerequisite
    Resize a disk online The instance to which the disk is attached must be in the Running (Running) state.

    After the disk is resized, the new size takes effect automatically with no need to restart its attached instance.

    Resize a disk offline The instance must be in the Running (Running) or Stopped (Stopped) state.

    After the disk is resized, you must restart its attached instance from the ECS console or by calling the RebootInstance operation for the new size to take effect.

  • Create a new disk, attach the disk to the instance, and then partition and format the disk.
  • Replace the system disk of the instance and specify a larger size for the new system disk. For more information, see Replace the system disk (public images).

Size range of system disks after resizing

The size of system disks after resizing must be greater than the value before resizing, but equal to or less than 500 GiB. The following table describes the size range allowed for system disks of different images after resizing.

Image Size range of system disks after resizing (GiB)
CoreOS and FreeBSD [Max{30, the size of the system disk before resizing}, 500]
Other Linux operating systems [Max{20, the size of the system disk before resizing}, 500]
Windows Server [Max{40, the size of the system disk before resizing}, 500]

For example, the size of the system disk of a CentOS instance before resizing is 35 GiB. After the system disk is replaced, the size of the new system disk must be greater than or equal to 35 GiB and less than or equal to 500 GiB.

Maximum sizes of data disks after resizing

The size of data disks after resizing must be greater than the value before resizing. The following table lists the maximum sizes of data disks of different categories after resizing.

Disk category Maximum size of data disks after resizing (GiB)
Basic disk 2,000
Ultra disk, standard SSD, or enhanced SSD 32,768

Procedure of resizing a disk

  1. Resize the disk by using the ECS console or calling the ResizeDisk operation.
  2. If you resize the disk offline, restart the instance from the ECS console or by calling the RebootInstance operation for the new size to take effect.
  3. Connect to the instance and extend the partitions and file system of the disk:
    Partitions created before disk resizing Disk size after resizing (GiB) Operations for extending partitions and file systems
    No < 2,048
    ≥ 2,048 Partition and format data disks of larger than 2 TiB
    Yes < 2,048
    ≥ 2,048
    • On partitions in Globally Unique Identifier Partition Table (GPT) format, you can perform the following operations:
    • On partitions in Master Boot Record (MBR) format, you cannot extend the partitions.
      Note Disks of more than 2,048 GiB cannot use the MBR partition format. You must make clear the partition format of a disk if you want to resize the disk to more than 2,048 GiB. If the disk uses the MBR partition format, we recommend that you create and attach another data disk to the instance. Apply the GPT partition format to the new data disk and copy the data from the MBR-formatted disk to the GPT-formatted disk.