Operate Disk Using CDS CMD Tool
Use CMD tools to operate disks
Users can execute some CDS disk-related operations via the cdscmd command. Currently supported functions are as follows
CMD uses a multi-layer command structure. All commands start with cdscmd, and [options] represents the functional options supported by CDS CMD.
1$ cdscmd [options]
2 $ # Example
3$ ./cdscmd resize
Parameter explanation
| Parameter item | Value | Description |
|---|---|---|
| options | Currently support resize parameter | Automatic expansion of disk |
Functions
Automatic expansion of data disk
Constraints
- Disks in the virtual machine must be unmounted - mounted disks cannot be operated;
- Only the data disk can be operated; the system disk will not be operated;
- Only single-partition disks are supported; multi-partition disks are temporarily unsupported;
-
The versions of the
fdisk and partedtools in some systems are rather outdated and require theexpectcommand interaction tool to complete expansion. Therefore,tcl and expecttools will be installed. If installation fails, manually installtcl and expectbefore retrying. Installation command:- CentOS system -
yum install tcl/expect; - Ubuntu system -
apt-get install tcl/expect;
- CentOS system -
Description:
Automatically complete processed disk expansion orders in the console.
Command format:
$./cdscmd resize
Description:
- Automatic expansion of new disks: Support MBR for disks below 2,048 GB and automatic GPT partitioning for larger disks. ext4 file system is created by default;
- Support old disk expansion operation of ext4 and xfs file systems;
- Old disk expansion: MBR - MBR, GPT - GPT, extending based on the original file system;
- Expand the file system on an old disk without partition;
Note: To ensure data security, a snapshot will be created for disks before expansion and partition, which requires users’ consent in advance before execution. Subsequent expansion can only be executed after successful snapshot creation. If the snapshot creation fails, the task terminates to safeguard data security. In addition, snapshots will incur certain snapshot fees, and you need to manually delete the snapshots after the expansion is completed.
