Initializing cloud disks
Last updated: 2019-10-17 16:12:09PDF
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
Formatting, creating a file system, and writing a file (Windows)
- Log in to the Windows CVM as the admin.
- Enter the disk management interface by selecting CVM Management > Storage > Disk Management.
- 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.
- 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.
This article takes
/dev/vdbas an example.
- 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
cd /data vi qcloud.txt
- In editing mode, you can input the related content. For example: “This is my first test”. Press ESC to exit the editing mode. Enter
:wqto save and exit the file.
- Execute the
lscommand, and you can see that the
qcloud.txtfile has been written to the disk.