How to backup ubuntu focal image to udsik on ROCK 5B?

This is a issue from one custom,now I share the guild here

Env:

  1. ROCK 5B
  2. OS :
    https://github.com/radxa/debos-radxa/releases/download/20230201-0944/rock-5b-ubuntu-focal-server-arm64-20230201-1200-gpt.img.xz
  3. EMMC 16G
  4. OS’s size 9GB

==

How to backup

step1:
download the script

step2:
prepare a udisk with ntfs format, insert the udisk to rock5b and mount

sudo mount -t ntfs /dev/xxx /media/path

Maybe you will encounter the system can’t mount ntfs udisk issue, you can do as below
sudo apt-get remove ntfsprogs && sudo apt-get install ntfs-3g

step3:
sudo ./path/rockpi-backup.sh -m rk356x -o /media/path/backup.img

step4:
get the backup image and re-flash to other emmc / sdcard / …