tencent cloud

Cloud Block Storage

User Guide
Announcements
Announcement of the Commercial Charges of Tencent Cloud CBS Snapshot
Announcement of the Commercial Charges of Tencent Cloud CBS Snapshot Cross-Region Replication
Product Introduction
Overview
Strengths
Scenarios
Regions and AZs
Cloud Disk Instances
Cloud Disk Snapshots
Access Management
Related Products
Predecessor
Service Regions and Service Providers
Billing
Billing Overview
Price Overview
Purchase Instructions
Renewal Guide
Overdue Payment
Getting Started
Step 1. Creating Cloud Disks
Step 2. Attaching Cloud Disks
Step 3. Initializing Cloud Disks
User Guide
Operation Overview
Usage Limits
Creating Cloud Disks
Attaching Cloud Disks
Initializing Cloud Disks
Expanding Cloud Disks
Detaching Cloud Disks
Terminating Cloud Disks
Viewing Cloud Disk Information
Adjusting Cloud Disk Types
Adjusting Cloud Disk Performance
Cloud Disk Data Protection Configuration
Cloud Disk Data Backup Point
Managing Snapshots
Monitoring and Alarms
Use Cases
Measuring Cloud Disk Performance
Building LVM Logic Volumes with Multiple Elastic Cloud Disks
Expanding MBR Cloud Disks to Greater Than 2 TB
Troubleshooting
Failed to Unmount Cloud Disks from Windows CVM Instances
Disk Not Mount upon Linux CVM Restart
API Documentation
History
Introduction
API Category
Making API Requests
Snapshot APIs
Cloud Disk APIs
Data Types
Error Codes
FAQs
Features
Billing
Performance FAQs
Snapshot
Usage
Cross-region Replication
CBS Service Level Agreement
Contact Us
Glossary

Extending Data Disk Partitions and File Systems Online

PDF
Focus Mode
Font Size
Last updated: 2025-09-18 18:15:58

Overview

Expanding a data disk via the console only increases its storage space. You need to extend the partition or file system of the cloud disk to the larger size. This document describes how to extend partitions and file systems online.

Prerequisite

Before extending partition or file system, create a snapshot of the cloud disk to back up data. For more information, see Creating Snapshots. This practice helps you roll back snapshot to recover data in case of data loss due to maloperation.
The cloud disk has been expanded and attached to a CVM via the console. For more information, see Expanding Cloud Disk Capacity.
The Linux CVM kernel should be version 3.6.0 or later. You can use the uname -a command to check the kernel version. If the kernel version is earlier than 3.6.0, see Determining the Expansion Method.

Operating Environment

Resource
Description
Operating system
CentOS 8.0 64-bit
Cloud disk (data disk)
/dev/vdb: Uses the MBR partition and the EXT4 file system, and expands from 50 GB to 60 GB via the console.
/dev/vdc: Uses the GPT partition and the XFS file system, and expands from 50 GB to 60 GB via the console.

Directions

Viewing partitions of the cloud disk

2. Run the following command to query partitions of the cloud disk.
fdisk -l
The following information appears:

As shown in the figure,
The 60 GB /dev/vdb data disk contains a 50 GB MBR partition /dev/vdb1.
The 60 GB /dev/vdc data disk contains a 50 GB GPT partition /dev/vdc1.
3. Run the following command to determine the file system type of existing partitions.
df -TH
The following information appears:

As shown in the figure,
The /dev/vdb1 partition is on an EXT4 file system that has been attached to /mnt/disk1.
The /dev/vdc1 partition is on an XFS file system that has been attached to /mnt/disk2.

Extending a partition

1. Use the command as needed to install the gdisk tool.
For a MBR partition, skip this step.
For a GPT partition, run the following command according to the operating system of the CVM.
CentOS
Ubuntu or Debian
yum install gdisk -y
apt-get install gdisk -y
2. Run the following command to install the growpart tool according to the operating system of the CVM.
CentOS
Ubuntu or Debian
yum install -y cloud-utils-growpart
apt-get install -y cloud-guest-utils
3. 
Run the following command to extend partitions using growpart.

Take extending the /dev/vdb1 partition as an example. Note that there is a space between /dev/vdb and 1 in the command. Replace with your actual values.
growpart /dev/vdb 1
If information similar to what is shown below is returned, the partition has been extended.



Extending a file system

1. Use the file system-specific command to resize a file system based on the type obtained in step 3.
Extending an EXT file system
Extending an XFS file system
Run the following command to extend the EXT file system.
resize2fs /dev/vdb1
The following information will appear:



Run the following command to extend the XFS file system.
xfs_growfs <Mount point>
Take mounting the /dev/vdc1 file system to`/mnt/disk2` as an example, then run the following command:
xfs_growfs /mnt/disk2
The following information will appear:



2. 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 extended.


3. Check data integrity and CVM running status after expansion. You can roll back the snapshot to recover data in case of exceptions. For more information, see Rolling Back Snapshots.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback