Restoring System Disk Data from a Snapshot After an OS Change
Scenarios
This section describes how to create a new disk from a standard snapshot of the original system disk and restore service data to the current system disk after an OS change or reinstallation.
For details about how to change or reinstall an OS and the precautions, see Reinstalling the OS and Changing the OS.
For details about the impacts of OS change and reinstallation on snapshots, see Can I Roll Back Data from a Snapshot After Reinstalling the OS or Formatting a Disk?
Preparations
Before starting the restoration, ensure that:
- A standard snapshot has been created for the system disk before the OS change or reinstallation. Otherwise, data cannot be restored after the operation. For details, see Creating an EVS Snapshot.
- The OS has been changed or reinstalled. Changing or reinstalling the OS overwrites the system disk data. Before doing so, ensure that you have recorded the directory path where the service data to be restored is located, so that you can find and restore data from the new disk. If you are not sure about the path, you can browse the directory structure after attaching the new disk.
- The ECS has available device names for data disks. For details about the number of data disks supported by each flavor, see Can I Attach Multiple Disks to an ECS?
This section describes how to restore the service data marker.txt in the /root directory of the original system disk to the current system disk after an OS change. The restoration process is the same for OS reinstallation. Replace the directory name and device name based on your actual conditions.
Step 1: Create a New Disk from a Snapshot of the Original System Disk
On the EVS console, create a new disk from a snapshot of the original system disk. For details about the creation methods and function restrictions, see Creating a Disk from a Snapshot.
- Sign in to the EVS console.
- In the navigation pane on the left, choose Elastic Volume Service > Snapshots.
- Locate the system disk snapshot created before the change and click Create Disk in the Operation column. Figure 1 Creating a disk from a snapshot
- Select the same availability zone (AZ) as the current ECS, confirm the configuration and price, and complete the disk creation as prompted.
The new disk can be attached only when it is in the same AZ as the ECS.
Step 2: Attach the New Disk and Restore Data
Attach the newly created disk to the current ECS and use it as a data disk. For details about how to log in to the ECS, see How Do I Log In to My ECS?
In the following example: The original system disk data is /root/marker.txt, the data disk partition is /dev/sdb1, and the mount point is /mnt/recovery. Adjust these values based on your actual conditions.
- Attach the new disk. (The device name is subject to the lsblk command output. /dev/sdb1 is used in this example.)
mount /dev/sdb1 /mnt/recovery
- Verify that data from the original system disk can be accessed.
- Use rsync to restore the required file to the current system disk (retaining attributes such as permissions, owners, and timestamps).
- Verify the restoration result. Figure 3 Transferring service data and verifying the restoration result
- After confirming that the data is correct, unmount the temporary disk (the new data disk).
Step 3: Delete the Temporary Disk
After data is restored, it is recommended that you detach and delete the temporary disk in a timely manner to avoid incurring additional charges. For details, see Detaching and Deleting an EVS Disk.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot

