docs
uhost
How Tos
Disk

Disk

For different operation scenarios regarding the disk, please refer to the corresponding operation guide.

View Disk Partition

After logging into the UHost, use the fdisk -l command to view the disk partition of the UHost (root permission is required in Ubuntu).

image

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:

TypeDisk LimitSupport Expansion Operation
Local Disk (Ordinary Local Disk, SSD Local Disk)100GBConfiguration Change
Cloud Disk500GBCreate Host, Configuration Change, System Reinstallation

Expansion Steps

Expansion when creating/reinstalling a host:

  1. On the create/reinstall host page, select the system disk size;
  2. Wait for the creation/reinstallation to complete, at this point the underlying block device has been expanded;
  3. Enter the host to check if the file system has been fully expanded.

Expansion by changing the configuration after creation:

The local system disk expansion takes a long time, expanding to 100G may require a shutdown wait of 30 minutes.

  1. Select "Change Configuration" -> "Change Disk Capacity" -> System Disk;
  2. Wait for the expansion to finish, the host enters the shutdown state, at this point the underlying block device has completed the expansion;
  3. Boot up, enter the host to check if the file system has completed the expansion.

Check if the file system has completed the expansion:

** Linux **

df -TH

** Windows **

Check if the size of the C drive on this computer is consistent with the control panel.

If the file system has not been expanded completely, then the system internal expansion steps need to be executed.

3. System Expansion Steps

** Linux **

  • Step 1: Install growpart

The cloud-init supported version image has growpart installed by default, other versions need to be installed manually, as follows:

CentOS:

yum install -y epel-release
yum install -y cloud-utils

Ubuntu:

sudo apt-get install cloud-initramfs-growroot
  • Step 2: Expand the Partition Table
LANG=en_US.UTF-8
growpart /dev/vda 1

?> For CentOS6 and Debian8, you may encounter situations where the kernel and toolchain do not support hot reloading of the partition table. If this happens, 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 if the expansion is complete:

df -TH

** Windows **

Select 'Expand Volume' in 'Computer Management' to complete the expansion. The specific operation steps are as follows:

Data Disk Expansion

1. Expansion Steps

Disk Type: Local Disk and Cloud Disk

In the control panel, select "Change Configuration". Currently, online upgrades are supported, but the system expansion steps need to be completed.

If the file system has not been expanded completely, you need to perform the system expansion steps.

2. System Expansion Steps

** Linux **

  • View the file system type of the data disk (upgrade operations need to take different actions for ext4 and xfs file systems)
df -ihT

image

image

  • If you are using an operating system with ext4 file format, please perform the following operations inside the cloud host (such as CentOS6).
resize2fs /dev/vdb
  • If you are operating a system with the xfs file format, please perform the following operations inside the UHost (such as CentOS7).
xfs_repair /dev/vdb
xfs_growfs /data
  • Confirm if the expansion was successful
df -TH

** Windows **

Operate on the host, enter diskpart.exe in cmd, then list volume, select the logical volume you want to expand, input extend [size=n] to expand the size, or extend will expand all unallocated size to the selected logical volume.

3. Host without local data disk before expansion

** Linux **

After the upgrade, the following operations need to be performed within the cloud host:

  1. You can choose to format the data disk in either ext4 or xfs file system formats.

  2. Set the data disk to the ext4 file format (the default file system format for CentOS6):""".

mkfs -t ext4 /dev/vdb 
mount /dev/vdb /data/
  1. Edit /etc/fstab, write the corresponding configuration into fstab
/dev/vdb   /data  ext4  defaults,noatime 0 0
  1. Set the data disk to xfs format (the default file system format for CentOS7):
mkfs.xfs /dev/vdb
mount -t xfs /dev/vdb /data
  1. Edit /etc/fstab, add the following content
/dev/vdb /data xfs defaults,noatime 0 0  

** Windows **

Operate on the host, enter diskpart.exe in cmd

  1. Enter list disk, select disk n (please fill in the specific value of n according to the actual situation) to select the data disk;
  2. Enter create partition primary to create a partition;
  3. Enter list volume to see the created volume. Enter format fs=ntfs quick to partition;
  4. Enter assign to allocate the drive number;
  5. Enter exit to exit, the system can now see the created disk.

Mount Cloud Disk

Go to the Host Management page in the console -> Mount Cloud Disk to perform the mounting operation.

Uninstall UDisk

You can only operate to uninstall the data disk, the system disk cannot be uninstalled. At the same time, the local disk does not support uninstallation and cannot be released separately.

1. Uninstall Cloud Disk within the System

** Linux **

The Linux operating system executes the following statement:

umount /dev/vdc

** Windows **

First, select the cloud disk in the disk manager, then right-click and choose "Offline".

Then select the cloud disk in the device manager, right-click and select "Uninstall".

These two operations are equivalent to performing a dismount operation on the cloud hard disk in the Windows system.

If there is only one C drive, the second one would be the cloud disk. It is recommended to backup the cloud disk (such as snapshots and clones) before expansion.
In the cloud disk list page of the console, select the cloud disk that needs to be expanded and unmount it. The status of the cloud disk will change from "Mounted" to "Available".

2. Console Operation

Go to the Console Host Management page -> Cloud Disk Management -> Uninstall to perform the uninstall operation.

Local Disk Shrink

The console does not support "shrinking" of local disks, but "shrinking" can be indirectly achieved through the following steps.

!> Please note, this operation will completely erase the data. Please back up your data before proceeding!!!

1. Delete Local Disk

?> The deletion of the local disk requires shutting down the system. First, enter the system internally to perform the uninstall operation. The steps are as follows:

** Linux **

umount /dev/vdc

** Windows **

First, select the cloud disk in the disk manager, right-click and choose "Offline"

Then select the cloud disk in the device manager, right-click and select "Uninstall".

After completing the uninstallation within the system, please select the specified host -> details -> disk and recovery -> delete local disk in the console.

Disk Snapshot

Disk Snapshot Service (USnap) is a service that provides the ability to create snapshots for all series of cloud disk data disks (General/SSD/RSSD) based on Data Ark CDP technology. A snapshot is a convenient and efficient means of data disaster recovery, commonly used for data backup, custom image creation, and application disaster recovery.

If you need to know more about snapshot related operations and features, please read Disk Snapshot Service USnap.

  • Company
  • ContactUs
  • Blog
Copyright © 2024 SurferCloud All Rights Reserved
  • Contact our sales to help your business.
  • Contact our sales to help your business.