Initializing cloud disks

Last updated: 2020-02-25 16:48:23

PDF

Operation Scenarios

This article will help you understand how to easily use cloud disks by taking as an example initializing a cloud disk that is newly mounted to a CVM, creating a file system, and writing a file named qcloud.txt . For more information on initializing cloud disks, see Initialization Scenarios .

Prerequisites

You have Mounted the cloud disk , and the cloud disk status is Mounted .

The following Windows and Linux CVM OS systems are used:

  • Windows Server 2008
  • CentOS 7.5

Notes

You can first understand Matters needing attention in the use of HDD cloud disk Then carry on the related operation to HDD cloud disk, so as not to damage the important data.

Formatting, creating a file system, and writing a file (Windows)

  1. Log in to the Windows Instance As the admin.
  2. Enter the disk management interface by selecting CVM Management > Storage > Disk Management .
  3. (Optional) Right click the target empty disk, and select Online .
    When the disk status changes to Not Initialized , it has gone online.
  4. (Optional) Right click the newly online cloud disk. select Initialize Disk , select Master Boot Record And click OK .

MBR (Main Boot Record) partition format supports a maximum disk capacity of 2TB, and GPT (GUID Partition Table) partition table supports a maximum disk capacity of 18EB. If you need to use a disk capacity larger than 2TB, please use the GPT partition format.
If the disk partition format is changed after the disk is put into use, the original data in the disk will be erased. Therefore, select the disk partition format carefully when initializing the disk.

  1. Right click the target disk, and select New Simple Volume .

  2. Enter the simple volume size, and click Next .

  3. Select the drive letter or drive path, and click "next". This article takes Assign drive letter E as an example. as shown below:

  4. Choose to format the partition, select file system, and then click Next .

  5. Click Finish .
    The target disk is formatting. You need to wait for the system to complete the initialization operation. When the volume status is Healthy , the disk initialization is successful. After the initialization is complete, you can view the newly formatted data disk in the PC Interface.

  6. Enter the newly formatted data disk, create a file named qcloud.txt , enter the content you need, and select File > Save .

Formatting, creating a file system, and writing a file (Linux)

  • This article takes EXT4 file system as an example.
  • When Linux CVMs restart or starts up, data disks will not be automatically mounted. For more information, see Formatting and mounting data disks .
  1. As the root user, Log In to the Linux CVM .
  2. Execute the following command to view names of data disks linked to the instance.
fdisk -l

Returned information is similar to what is shown in the following figure, which indicates that the current CVM has two disks, /dev/vda Is the system disk, and /dev/vdb Is the newly added data disk.
The name of the disk that this article connects to the instance to /dev/vdb As an example. as shown below:

  1. Execute the following command to format the disk.
mkfs.ext4 /dev/vdb
  1. Execute the following command to mount this disk to the /data Mounting point.
mount /dev/vdb /data
  1. Run the following commands to enter the disk and then create a new file called qcloud.txt .
cd /data
vi qcloud.txt
  1. Press I to enter the editing state. Enter "This is my first test." and press ESC to exit the editing state and enter : wq , save and exit the file
  2. Execute the ls Command, and you can see that the qcloud.txt File has been written to the disk.