docs
uhost
Operation Guide
Disk

Disk

For different operating scenarios of disks, please find the corresponding operation guides

View Hard Disk Partitions

After logging into the cloud server, use the fdisk -l command to view the hard disk partition of the cloud server (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:

TypeDisk LimitSupport Expansion Operation
Local Disk (ordinary local disks, SSD local disks)100GBChange Configuration
Cloud Disk500GBCreate host, Change configuration, reinstall system

2. Expansion Steps

Expanding When Creating/Reinstalling the Host:

  1. On the create/reinstall host page, choose the system disk size;
  2. Wait for the create/reinstall to finish, and the underlying block device has been expanded;
  3. Enter the host to check if the file system has been expanded.

Expand After Creation 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.

  1. Select "Change Configuration" -> "Change Disk Capacity" -> System Disk;
  2. Wait for the expansion to complete, the host enters the shutdown state, and the underlying block device has been expanded;
  3. Start up, 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 ** steps to expand within the system **.

3. Steps to Expand Within the System

** 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 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, it currently supports online upgrade, but you need to complete ** steps to expand within the system **.

If the file system has not been fully expanded, you need to perform ** steps to expand within the system **.

2. Steps to Expand Within the System

** 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 cloud host (such as CentOS6)
resize2fs /dev/vdb
  • If it is an operating system of xfs file format, please perform the following operations inside the cloud host (such as CentOS7)
xfs_repair /dev/vdb
xfs_growfs /data
  • Confirm whether the expansion is successful
df -TH

** Windows **

Operate on the host, type diskpart.exe in cmd, list volume, choose the logical volume to expand size, input extend size=n] or extend to extend all unallocated size to 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 cloud host:

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

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

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

** Windows **

Operate on the host, type diskpart.exe in cmd.

  1. Type list disk, select disk n (please fill in the specific value of n according to actual conditions), select the data disk.
  2. Type create partition primary, create partition.
  3. Type list volume, you can see the created volume. Type format fs=ntfs quick to partition.
  4. Type assign, assign the drive letter.
  5. Type exit to exit, the system can already see the created disk.

Mount Cloud Disk

From the console host management page->mount cloud disk, proceed with the mount operation.

Then do the following operations inside the cloud host:

mkdir /udisk
mount /dev/vdc /udisk
df -h

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

From the console host management page->cloud disk management->unmount, proceed with the unmount operation.

Local Disk Shrinking

The console does not support "shrink" of the local disk, but the "shrink" can be effectively realized through the following steps.

Please note that this operation will completely wipe your data, please back up the data before operation!!!

1. Delete Local Disk

Deleting a local disk requires shutting down. First, go into the system to perform the unmount operation. The operation steps are:

** Linux **

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".

After completing the unmount operation in system, please select in the console Specific Host->Details->Disk & Recovery->Delete Local Disk.

2. Add Local Disk

Please select in the console Specific Host->Details->Disk & Recovery->Create Local Disk, Choose an appropriate size.

After the new creation, please perform the following operations inside the host:

Linux

After upgrading, perform the following operations inside the cloud server:

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

  2. Set the data disk as ext4 file format (the default file system format of CentOS6):

mkfs -t ext4 /dev/vdb 
mount /dev/vdb /data/
  1. Edit/etc/fstab and write the corresponding configuration into fstab
/dev/vdb   /data  ext4  defaults,noatime 0 0
  1. Set the data disk as xfs format (the default file system format of 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, type diskpart.exe in cmd.

  1. Type list disk, select disk n(please fill in the specific value of n according to actual conditions), select the data disk.
  2. Type create partition primary, create a partition.
  3. Type list volume, you can see the created volume. Type format fs=ntfs quick to partition.
  4. Type assign, assign the drive letter.
  5. Type exit to exit. The system can already see the created disk.

In the same way, the cloud disk does not support direct "shrink". But you can create a smaller cloud disk after unmounting, and mount it directly.
If you want to learn more about disk-related functions and information, please read UDisk Cloud Hard Disk.

Disk Snapshot

Disk Snapshot Service (USnap) provides the ability to create snapshots for all series of cloud hard disk data disks (ordinary / SSD / RSSD) based on CDP technology. The snapshot is a convenient and efficient data disaster recovery method, which is commonly used for data backup, making custom images, application disaster recovery, etc.

  • Company
  • ContactUs
  • Blog
Copyright © 2024 SurferCloud All Rights Reserved