Disk
For different operating scenarios of disks, please find the corresponding operation guides
View Hard Disk Partitions
After logging into the UHost, use the fdisk -l
command to view the hard disk partition of the UHost (need root permissions with Ubuntu ).
System Disk: /dev/vda
Data Disk 1: /dev/vdb
Data Disk 2: /dev/vdc
System Disk Expansion
1. Expansion Rules
Different disk types follow different disk expansion rules:
Type | Disk Limit | Supported Expansion Operation |
---|---|---|
Local Disk (ordinary local disks, SSD local disks) | 100GB | Changing configuration |
Cloud Disk | 500GB | Creating a UHost, changing configuration, and reinstalling the system |
2. Expansion Steps
Expansion When Creating/Reinstalling the Host:
- On the host creation/reinstallation page, choose the system disk size;
- Wait for the creation/reinstallation to finish, when the underlying block device has been expanded;
- Enter the host to check if the file system has been expanded.
After-Creation Expansion by Changing Configuration:
The extension time of the local system disk is long, and it may take 30 minutes to shut down to expand to 100G.
- Select “Change Configuration” -> “Change Disk Capacity” -> System Disk;
- Wait for the expansion to complete, when the host enters the shutdown state, and the underlying block device has been expanded;
- Start up, and enter the host to check if the file system has been expanded.
Check If the File System Has Been Expanded:
** Linux **
df -TH
** Windows **
This PC-> Check if the size of C drive is consistent with the console
If the file system has not been fully expanded, you need to perform in-system expansion steps.
3. In-system Expansion Steps
** Linux **
- Step 1: Install growpart
Growpart is already installed in the cloud-init supported edition image, and other versions need to be installed by themselves, the process is as follows:
CentOS:
yum install -y epel-release
yum install -y cloud-utils
Ubuntu:
sudo apt-get install cloud-initramfs-growroot
- Step 2: Expand Partition Table
LANG=en_US.UTF-8
growpart /dev/vda 1
CentOS6 and Debian8 may encounter a situation where the kernel and toolchain do not support hot reloading of partition tables. In this case, you need to restart the operating system once after expanding the partition table.
- Step 3: Expand the File System
resize2fs /dev/vda1 (ext4 file system)
xfs_growfs /dev/vda1 (xfs file system) or xfs_growfs /
- Step 4: Confirm
Check whether the expansion is completed:
df -TH
** Windows **
Select expand volume in “Computer Management” to complete the expansion. Specific operation steps as follows:
Data Disk Expansion
1. Expansion Steps
Disk Type: Local Disk and Cloud Disk
Select “Change Configuration” in the console, which currently supports online upgrade, but you need to complete in-system expansion steps.
If the file system has not been fully expanded, you need to perform in-system expansion steps.
2. In-system Expansion Steps
** Linux **
- Check the file system type of the data disk (upgrade operations need to take different actions against ext4 and xfs two file system types)
df -ihT
- If it is an operating system of ext4 file format, please perform the following operations inside the UHost (such as CentOS6)
resize2fs /dev/vdb
- If it is an operating system of xfs file format, please perform the following operations inside the UHost (such as CentOS7)
xfs_repair /dev/vdb
xfs_growfs /data
- Confirm whether the expansion is successful
df -TH
** Windows **
To operate on the host, type diskpart.exe
in cmd, then type list volume
, select the logical volume for size extension, input extend [size=n] to specify the extension size (where n represents the size value) or simply use extend to expand all unallocated space into the selected logical volume.
3. Host without Local Data Disk Before Expansion
** Linux **
After the upgrade, the following steps need to be performed inside the UHost:
-
You can choose ext4 or xfs as the system format to format the data disk
-
Set the data disk to ext4 file format (the default file system format of CentOS6):
mkfs -t ext4 /dev/vdb
mount /dev/vdb /data/
- Edit /etc/fstab and write the corresponding configuration to fstab
/dev/vdb /data ext4 defaults,noatime 0 0
- Set the data disk to xfs format (the default file system format of CentOS7):
mkfs.xfs /dev/vdb
mount -t xfs /dev/vdb /data
- Edit /etc/fstab and add the following content
/dev/vdb /data xfs defaults,noatime 0 0
** Windows **
Operate on the host, and type diskpart.exe
in cmd.
- Type
list disk
,select disk n
(please fill in the specific value of n according to actual conditions), and select the data disk. - Type
create partition primary
, and create partitions. - Type
list volume
, and you can see the created volume. Typeformat fs=ntfs quick
to partition. - Type
assign
to assign the drive letter. - Type
exit
to exit, and you can already see the created disk in the system.
Mount Cloud Disk
Go to the host management page in the console -> Mount Cloud Disk to perform the mounting operation.
You can also use the udisk attach (UCloud Global CLI) command to mount a cloud disk by specifying the availability zone and cloud host instance ID. Use the —udisk-id parameter to specify the cloud disk resource ID. For example:
UCloud Global udisk attach --udisk-id bsm-bagfqw5u --zone cn-bj2-05 --uhost-id uhost-bh0fvsnh/UHost
Output of the above example:
udisk[bsm-bagfqw5u] is attaching to uhost uhost[uhost-bh0fvsnh]...done
Then perform the following operations on the UHost: (Temporary Mounting – Mount points will be lost after reboot)
mkdir -p /data1
mkfs -t xfs /dev/vdc
mount /dev/vdc /data1
(Permanent Mounting)
mkdir -p /data1
echo -e "/dev/disk/by-id/virtio-UCloud Global_DISK_VDC\t/data1\tauto\tdefaults,nofail,discard,comment=cloudconfig\t0\t2" >> /etc/fstab
Unmount Cloud Disk
You can only operate to unmount the data disk, the system disk cannot be unmounted. Meanwhile, local disks do not support unmounting, and do not support separate release.
1. Unmount Cloud Disk within System
** Linux **
Execute the following statement in the Linux system:
umount /dev/vdc
** Windows **
First select the cloud disk in the disk manager, right-click and select “Offline”.
Then select the cloud hard disk in the device manager, right-click and select “Unmount”.
These two operations are equivalent to performing a dismount operation on the cloud hard drive in the Windows system.
If there is only one C drive, the second one is the cloud hard drive. It is recommended to make a backup of the cloud hard drive before the expansion (such as snapshots and clones).
Select the cloud hard drive that needs to be expanded on the cloud hard drive list page of the console and unmount it. At this time, the status of the cloud hard drive will change from “Mounted” to “Available”.
2. Console Operation
Go to the host management page in the console → Cloud Disk Management → Unmount to perform the unmounting operation.
You can also use the udisk detach (UCloud Global CLI) command to unmount a cloud disk by specifying the availability zone. Use the —udisk-id parameter to specify the cloud disk resource ID. For example:
UCloud Global udisk detach --udisk-id bsm-bagfqw5u --zone cn-bj2-05
Output of the above example:
Please confirm that you have already unmounted file system corresponding to this hard drive,(See "https://docs.UCloud Global.cn/udisk/userguide/umount" for help), otherwise it will cause file system damage and UHost cannot be normally shut down. Sure to detach? (y/n):y
udisk[bsm-bagfqw5u] is detaching from uhost[uhost-bh0fvsnh]…done
Disk Snapshot
Disk Snapshot Service (USnap) leverages the Data Ark CDP technology to provide the capability of creating snapshots for all series of cloud disk data disks (standard/SSD/RSSD). Snapshots serve as a convenient and efficient data disaster recovery method, commonly used for data backup, creating custom images, application disaster recovery, and other scenarios.