Single-Partition Data Disk_Linux
This operation example defaults to a data disk capacity of less than 2TiB. If the data disk capacity is greater than 2TiB, please refer to the chapter “Partition Expansion for Disks Larger Than 2TiB”.
If the host has only one partition created before and uses the ext3/4 file system, you can use the following method for expansion.
Notes:
It is recommended that you do not partition the cloud disk on the cloud host to avoid affecting the expansion of the cloud disk.
Before performing disk expansion, please confirm that if there is data in the data disk, it is recommended to back up the data first.
A cloud disk can only be expanded when it is in an available state. Since the cloud disk needs to be unmounted, your business will be interrupted, so please operate with caution.
Operation Instructions:
This example uses the fdisk command. The parted command cannot be used interchangeably with the fdisk command.
In this example, the mount point of the cloud disk is /dev/vdb. Please operate according to your actual situation. If the corresponding device is not found, please check the mounting information and status of the cloud disk.
Specific Operations:
Check the current mounting status, file system type, and partition status.
Note: The result of the lsblk command shows that there is only one partition vdb1 under vdb, which is a single partition. You can expand it according to the solution described in this document. For other cases, please refer to the corresponding documents for expansion.
Unmount the cloud disk in the operating system and console. For specific steps, see the chapter on unmounting cloud disks. Expand the cloud disk via the cloud disk console.
Mount the cloud disk in the console. For specific steps, see the chapter on mounting cloud disks. After mounting is completed, check the disk size in the operating system.
Use the fdisk command to delete the original partition and create a new partition.
Note: Deleting a partition will not cause data loss in the data disk.
Check the file system and expand it.
Note: The commands for checking and expanding differ under different file systems. Please confirm your file system type and follow the corresponding operation steps.
ext4 file system
Perform e2fsck -f /dev/vdb1 and resize2fs /dev/vdb1 for inspection and expansion operations.
Use the mount command to re-mount the disk.
xfs file system
Run xfs_repair /dev/vdb1 to check the file system.
Use the mount command to re-mount the disk.
Run the xfs_growfs command to expand.