When you have put a lot of effort into configuring the tools on the nano, you definitely don’t want to have to do the same work with a new card.
So how can I save and restore the contents of the entire card?
Backup tf card:
Insert the nano card into the ubuntu machine using a card reader
sudo fdisk -u -l
Then use the following command to mirror and compress the tf card
sudo dd if=/dev/sdd | gzip >/home/guo/eng/nano/nano_test_20200308_v01.img.gz
If the system disk is too small to fit, it needs to be placed on a mechanical hard drive.
sudo dd if=/dev/sdd | gzip >/media/guo/office2T/nanos/nano_good_20200309_v01.img.gz
when recovering
sudo gzip -dc /home/guo/eng/nano/nano_test_20200308_v01.img.gz | sudo dd of=/dev/sdd