Open the terminal of the Ubuntu computer (virtual machine) system and enter the following command to install the partition management tool gparted
sudo apt install gparted
Remove the solid-state drive from the motherboard, insert it and connect it to the computer (virtual machine). At this time, the computer will automatically recognize the solid-state drive (requires a solid-state drive box).
Open the application repository of the computer (virtual machine), search for and open gparted
Attention: Incorrect operation may cause the system or files to malfunction. In this step, it is important to select the correct disk device number.
Record disk device number:/dev/sdb
Enter the following command to view partition information, record the numbers in the Free Space row and Start column,Pay attention to removing the last unit s.
xxxxxxxxxx
./parted_info.sh /dev/sdb
The/dev/sdb parameter must be specified, which is consistent with the disk device number viewed in the previous step.
If parted_ The info.sh file does not have permission to run. Enter chmod+x parted_ Add permissions to info.sh.
parted_info.sh Content
xxxxxxxxxx
date
echo $1
sudo parted $1 <<EOF
unit s
print free
quit
EOF
Open the system terminal, and the storage space of the computer (virtual machine) must be greater than the image.
xxxxxxxxxx
sudo dd if=/dev/sdb of=backup.img bs=512 count=27875328
if=/dev/sdb:For the disk device number found in the first step of=backup.img:Is the name of the backup bs=512:Indicates block size count=27875328:Represents the backup size, which is obtained from the second step.
Restart a terminal and run the following command to check the progress.
xxxxxxxxxx
sudo watch -n 3 pkill -USR1 ^dd$
Wait for the backup to complete.
Due to the fact that the backed up image is on a Linux computer (virtual machine), it is necessary to turn on the shared folder function in the virtual machine to transfer the files to Windows.
Click on the settings of the virtual machine
Click on 'Options' -' Shared Folder '-' Always Enable '-' Add ', and then add the location of the Windows computer as a shared folder,Taking adding to path D:\Virtual Machines\share as an example in the following figure.Click OK to save the configuration.
Copying Mirror Files to a Shared Folder
xxxxxxxxxx
sudo cp backup.img /mnt/hgfs/share/
So far, the mirror backup is complete.