This article introduces how ECS uses snapshots to create disks to achieve lossless expansion of data disks, and focuses on the specific steps. The content of this article is compact, and I hope you can gain something from it.
ECS uses snapshots to create disks to achieve lossless expansion of data disks
When expanding the data disk, if you encounter disk problems that prevent lossless expansion, you can temporarily purchase an independent cloud disk to store the data , and then completely format the data disk to solve the problem. The following are the steps:
1. First create a snapshot based on the current data disk to back up the data. At the same time, you can use this snapshot to directly create an independent cloud disk to save data from copying back and forth. Time
2. Open the independent cloud disk purchase page (https://ecs-buy.aliyun.com/#/clouddisk), select the region in the same availability zone as ECS, and purchase an independent cloud disk. When purchasing, directly choose to create a disk with a snapshot and use the snapshot in the first step.
3. Open the ECS console disk page, find the independent cloud disk you just purchased, and mount the independent cloud disk to ECS in the more options.
#4. Log in to the server, use the mount command to mount this independent cloud disk to the system, and check whether the files in it are consistent with those in the data disk.
5. After confirming that the data in the independent cloud disk is correct, first use fdisk to delete the original partition table, and then use fdisk, mkfs.ext3, etc. to re-pair the data disk. Perform partitioning and formatting operations to make the available space of the data disk the size after expansion.
6. Then use the cp -R command to copy all the data in the independent cloud disk back to the data disk. You can add the --preserve=all parameter to retain the file attributes during copying.
7. umount the independent cloud disk in ECS.
8. Unmount this independent cloud disk in the ECS disk console. After uninstalling, select Release (uninstall first, then release), and the operation is completed.
The above is the detailed content of How ECS uses snapshots to create disks to achieve lossless expansion of data disks. For more information, please follow other related articles on the PHP Chinese website!