How to backup my rootfs

When you mounted it sounds correct how you did this. Can I verify this is an eMMC model and not an SD card model? If it is SD card, then things wouldn’t work as expected. I ask because I want to verify your target really is “jetson-xavier-nx-devkit-emmc”; if it is the eMMC model, but on an alternate carrier board, then some changes are probably needed.

When restoring you’d end up using the “-r” option in the flash.sh command, and this prevents overwriting whatever content you have in the file “Linux_for_Tegra/bootloader/system.img”. You would copy your unmounted image to that file name (you could save space with move instead of copy, but either way, this takes a long time). Once the image is there, then it is safe to run “sudo ./flash.sh -r jetson-xavier-nx-devkit-emmc mmcblk0p1”. Note that I used "mmcblk0p1, not mmcblk1p1. I think in most boards the “1” version would be the wrong device.