Hi, I would like to make a clone of my APP partition (in NVME) then restore it.
I tried to expirement with commands in the readme of initrd flashing to try to restore, but all failed.
My system is a Jetson Xavier NX production module (16GB EMMC) on a SEEED A206 carrier, with 128GB NVME.
The rootfs (APP partition) is in the NVME.
Installation
The Xavier was initially installed by flashing the external NVME and QSPI. It was a combination of workflows #3 and #4 in README_initrd_flash.txt. The EMMC does not contain an APP partition, only the external drive has it.
The command I used is:
sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNvme.dtbo" ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml --no-systemimg" --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1
Note that with this command, I used the vanilla configuration flash_l4t_external.xml, which means that the num_sectors
was not changed, so it was not correct. But this doesnt matter as the script will correct it.
Cloning
After it was done, I cloned the APP partition (nvme0n1p1) on the Xavier. This was done on the Xavier itself by connecting an external drive, on which the image will be saved. I want to save space so did it using img2simg, which produces a sparse image.
The command I used was:
sudo img2simg /dev/nvme0n1p1 /mnt/ext_hdd1/system.img.ext
I also took note of the following parameters since I found that these may be needed later:
- NVME drive sector size (
cat /sys/block/nvme0n1/queue/hw_sector_size
) - NVME drive number of sectors (
cat /sys/block/nvme0n1/size
) - APP partition (nvme0n1p1) size in bytes (
sudo blockdev --getsize64 /dev/nvme0n1p1
)
Restoring
Now I have a sparse image of the app partition. I know that this image can’t be flashed by flash.sh
since it can’t touch external hardware. I tried to use the backup and restore tool l4t_backup_restore.sh
but sadly, it can ONLY backup partition in the EMMC partitions.
The only tool that I can use is l4t_initrd_flash.sh
.
I tried a bunch of workflows but none worked for me.
What I usually do is:
- Generate the image but not flashing it (
--no-flash
). - Replace
system.img
andsystem.img.sha1sum
onLinux_for_Tegra/tools/kernel_flash/images/external
with the cloned image - Flash it by using
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only
I tried a bunch of stuff, like changing num_sectors
in the configuration xml, since I thought flash.idx
was not in line with the copied clone system.img
.
I don’t know what else to try, please help me! T_T