Help & Documentation>Cloud Block Storage

Determining the Expansion Method

Last updated: 2023-09-22 14:47:06

Scenario

Cloud Block Storage (CBS) is a scalable storage device in the cloud. You can expand its size at any time after creation to increase storage space without losing the existing data on the CBS.
After completing the Cloud Disk Expansion via the console, you also need to allocate the expanded capacity to the existing partitions within the cloud server instance. You should choose the best CBS expansion method based on your actual needs. This document explains how to determine the CBS expansion method on a Linux cloud server.
Note
The process of expanding the file system could potentially affect existing data. Therefore, it is advisable to manually create a snapshot to back up your data prior to initiating the operation.

Preparations

You have already expanded the cloud disk via the console.
The cloud disk has been attached to a Linux cloud server and a file system has been created. For more details, please refer to Attaching Cloud Disks.
You have logged into the Linux cloud server where the partition and file system to be expanded are located. For more details, please refer to Logging in to Linux Instance Using Standard Login Method (Recommended).

Instructions

1. Execute the following command as a
root user
to query the partition format used by the cloud disk.
fdisk -l
If the result shows no partition (only /dev/vdb is displayed as in the image below), follow the steps in the Expand File System section below.

If the results are as shown in the two images below (which may vary depending on the operating system), follow the steps for GPT partition as outlined in the table below.


If the following result is shown (which may vary by operation system), proceed according to the MBR Partition steps in the table below.

2. Based on the cloud disk partition format found in Step 1, select the appropriate expansion method in accordance with the actual situation of the cloud disk.
Note
MBR partition supports disk with a maximum capacity of 2 TB.
When you partition a disk with a capacity greater than 2 TB, we recommend you create and mount a new data disk and use the GPT partition format to copy data.
Partition format
Scaling
Note
-
This is applicable for scenarios where no partition has been created and a file system has been directly created on the raw device.
GPT
Expand the existing GPT partition.
Maintain the original partition unchanged, and create a new GPT partition for the expanded part.
MBR
Expand the existing MBR partition.
Maintain the original partition unchanged and create a new MBR partition with the expanded part.