Tenant Cloud Storage Cloud Block Storage Operation Guide Expanding System Disk Partitions and File Systems Online

Expanding System Disk Partitions and File Systems Online

Last Updated At: 2025-11-12 13:13:10

Scenarios

Expanding a data disk in the console only increases its storage capacity. You need to expand the partition or file system of the cloud disk. This document describes how to expand partitions and file systems online.

Prerequisites

  • Before following the steps in this document, create a snapshot of the system disk for the corresponding instance to back up data. For details, see Creating a Snapshot.
    In case of data loss due to misoperation, you can roll back the snapshot to recover the data.
  • You have expanded the cloud disk in the console. For detailed directions, see Expanding Cloud Disks.
  • The kernel version of Linux CVM should be later than 3.6.0. You can use theuname -a command to check the kernel version.

Operating Environment

Linux instance

Resources Description
Operating System CentOS 8.0 64-bit
Cloud disk (system disk) /dev/vda: uses MBR partition and ext4 file system, and has been expanded online from 50 GB to 60 GB via the console.

Windows instance

Resources Description
Operating System Windows Server 2012 R2 IDC 64-bit
Cloud disk (system disk) C drive: uses MBR partition and NTFS file system, and has been expanded online from 50 GB to 100 GB via the console.

Operation Steps

Linux Operating System

Perform the following steps based on your operating system:

  1. Log in to the CVM instance as instructed in Logging In to Linux Instances.

  2. Execute the following command to query the partition information of the cloud disk.

    fdisk -l
    

    The returned result is as shown in the figure below. It can be seen that the dev/vda data disk has a capacity of 60 GB, containing an MBR partition /dev/vda1 with a capacity of 50 GB.

  3. Execute the following command to determine the file system of existing partitions.

    df -TH
    

    The returned result is as shown in the figure below, indicating that /dev/vda1 has a file system type of ext4.

  4. Based on the CVM operating system type, execute the following command to install the growpart tool.

    • CentOS

      yum install -y cloud-utils-growpart
      
    • Ubuntu or Debian

      apt-get install -y cloud-guest-utils
      
  5. Execute the following command to use the growpart tool to expand the partition /dev/vda1. In the command, /dev/vda and 1 need to be separated by a space.

    growpart /dev/vda 1
    

    The returned result is as shown in the following figure:

  6. Execute the following command to expand the ext4 file system.

    resize2fs /dev/vda1
    

    The returned result is as shown in the following figure:

  7. Run the following command to view the scaling-out result.

    df -TH
    

    The returned result is shown in the following figure, indicating that the expansion succeeds.

    After the expansion succeeds, check data integrity and observe whether the business in the CVM is running normally.

Windows Operating System

Perform the following steps based on your operating system:

  1. Log in to the CVM instance as instructed in Logging In to Windows Instances.
  2. On the desktop, right-click d31f2d1c79409188f9465a041455b5cf.png (23×23) in the lower-left corner and click Disk Management in the pop-up menu.
  3. In the Disk Management pop-up window, select Operation > Rescan the disk the disk at the top of the page.
    After the scan is completed, you can view the new space.
  4. Right-click the area of the C drive and select Expand Volume in the pop-up menu.
  5. Follow the Expand Volume Wizard to expand the volume. After the operation, the newly added space will be merged into the original volume.
    After the expansion succeeds, check data integrity and observe whether the business in the CVM is running normally.