Initializing cloud disks
Last updated: 2020-02-25 16:48:23PDF
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 .
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
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)
- Log in to the Windows Instance As the admin.
- Enter the disk management interface by selecting CVM Management > Storage > Disk Management .
- (Optional) Right click the target empty disk, and select Online .
When the disk status changes to Not Initialized , it has gone online.
- (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.
Right click the target disk, and select New Simple Volume .
Enter the simple volume size, and click Next .
Select the drive letter or drive path, and click "next". This article takes Assign drive letter E as an example. as shown below:
Choose to format the partition, select file system, and then click Next .
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.
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 .
- As the root user, Log In to the Linux CVM .
- Execute the following command to view names of data disks linked to the instance.
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:
- Execute the following command to format the disk.
- Execute the following command to mount this disk to the
mount /dev/vdb /data
- Run the following commands to enter the disk and then create a new file called
- 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
- Execute the
lsCommand, and you can see that the
qcloud.txtFile has been written to the disk.