To restore data, a system disk snapshot of ECS A is used to create disk A. Then, disk A is attached to ECS B as a data disk. However, after ECS B is restarted, data disk A may be attached as the root file system but not the system disk of ECS B. In such a case, the data of ECS A is contained in the root file system of ECS B.
When Linux ECSs start, the root file systems to be mounted are identified by disk label but not UUID. However, system disk labels are the same, which may lead to a system disk attachment error.
Replace the /dev/disk/by-label/ROOT files in /etc/fstab with the files in /dev/disk/by-id. The new files start with a unique virtio-EVS-ID.
To do so, perform the following operations:
/dev/disk/by-label/ROOT / ext4 defaults 1 1
total 0 lrwxrwxrwx. 1 root root 9 Nov 16 19:40 virtio-20211065-0f57-46d4-9 -> ../../vda lrwxrwxrwx. 1 root root 10 Nov 16 19:40 virtio-20211065-0f57-46d4-9-part1 -> ../../vda1 lrwxrwxrwx. 1 root root 9 Nov 16 19:40 virtio-842dbfd3-9f2c-4273-9 -> ../../vdb lrwxrwxrwx. 1 root root 10 Nov 16 19:40 virtio-842dbfd3-9f2c-4273-9-part1 -> ../../vdb1
/dev/disk/by-id/virtio-20211065-0f57-46d4-9-part1 / ext4 defaults 1 1 /dev/disk/by-id/virtio-842dbfd3-9f2c-4273-9-part1 /vdb1-test ext4 defaults 1 1