Back up and restore Ubuntu 20.04 LTS
Steps
1. Prepare two USB sticks as follows:
a. Prepare one USB stick to store the target Ubuntu image. Use the following command to back up your SSD data as an
image on the USB stick:
$ sudo dd if=/dev/sdx of=/meida/ubuntu/<USB stick name>/<image file name>
status=progress
b. Prepare another USB stick as Ubuntu Desktop live USB, with the 21.10 or newer version, as detailed in
2. Use Ubuntu Desktop live USB to boot up the device by BIOS, and then select
Try Ubuntu
.
Figure 58. Try Ubuntu
3. Clear the target SSD. For secure-erase supported SSD, see
on page 76. Or use the basic clear
command:
$ sudo dd if=/dev/zero of=/dev/sdx bs=<block size> count=<block number>
status=progress
4. Plug in the USB stick that contains the backup image file, then open the Ubuntu terminal.
5. Use the following command to flash the backup image from the USB stick to the target SSD.
$ sudo dd if=/media/ubuntu/<USB stick name>/<image file name> of=/dev/sdx
status=progress
NOTE:
Typically, the image USB stick is mounted under
/media/ubuntu/<USB stick name>
, and the target SSD is
mounted as
/dev/sdx
.
6. When finished, reboot the platform and boot up with the target SSD, and then you can return to your backup environment.
60
Setting Up the Ubuntu Operating System