Help & Documentation>Cloud Block Storage>Operation Guide>Expanding cloud disks>Extending System Disk Partitions and File Systems Online

Extending System Disk Partitions and File Systems Online

Last updated: 2026-05-13 10:54:07

Scenario

After expanding the storage capacity of a cloud disk used as a system disk through the console, you still need to expand the cloud disk partition or file system. This document will guide you on how to expand the partition and file system without interrupting the service.

Preparations

Before proceeding with the steps outlined in this document, please create a snapshot for the corresponding instance system disk to back up the data. For more information, see Creating Snapshots. In case of data loss due to an error, you can roll back the snapshot to recover the data.
You have already expanded the cloud disk capacity through the console. For more information, see Expanding System Disk.
The Linux CVM kernel version should not be lower than 3.6.0. You can use the uname -a command to check the kernel version. If the kernel version is lower than 3.6.0, you can refer to Offline Expansion of MBR Partition and File System for operations.

Operating Environment

Linux Instances
Windows Instances
Resources
Note
Operating System
CentOS 8.0 64-bit
Cloud disk (system disk)
/dev/vda: Uses the MBR partition and the EXT4 file system, and expands from 50 GB to 60 GB online in the console.

Resources
Note
Operating System
Windows Server 2012 R2 Datacenter 64-bit Chinese
Cloud disk (system disk)
Drive C: Utilizing MBR partition and NTFS file system, its capacity has been expanded from 50GB to 100GB online through the console.


Instructions

Please execute the following steps according to the operating system of your instance:
Linux Instances
Windows Instances
1. Log in to the cloud server. For more information, see Logging in to Linux Instance Using Standard Login Method (Recommended).
2. Run the following command to query partitions of the cloud disk.
fdisk -l
The result returned is as shown below, indicating that the dev/vda data disk has a capacity of 60GB, which includes the MBR partition /dev/vda1 with a capacity of 50GB.

3. Run the following command to confirm the file system that has a partition.
df -TH
The following result shows that the file system type of /dev/vda1 is ext4.

4. Run the following command to install the growpart tool according to the operating system of the CVM.
CentOS
yum install -y cloud-utils-growpart
Ubuntu or Debian
apt-get install -y cloud-guest-utils
5. Run the following command to use the growpart tool to expand the partition /dev/vda1. In the command, /dev/vda and 1 must be separated by a space.
growpart /dev/vda 1
The following information will appear:

6. Run the following command to extend the EXT4 file system.
resize2fs /dev/vda1
The following information will appear:

7. Run the following command to view the result.
df -TH
If information similar to what is shown below is returned, the file system has been expanded successfully.

Check data integrity and CVM running status after expansion.
1. Log in to the cloud server. For more information, see Logging in to Windows Instance Using Standard Method.
2. Right-click on the
d31f2d1c79409188f9465a041455b5cf.png (23×23)

at the lower left corner of the desktop, search and select Disk Management.
3. In the window, choose the expanded disk and click right button select Action > Rescan Disks from the top of the interface. See below:


After the scan is completed, you can view the added space. See below:

4. Right-click on the C drive area and select Extend Volume from the pop-up menu, as shown in the figure below:


5. Follow the Expand Volume Wizard to expand the volume. After the operation, the newly added space will be merged into the original volume. See below:


Check data integrity and CVM running status after expansion.