Jetson/AGX Xavier Alternative For Cloning

Usually developers want to clone root file system of one Jetson AGX Xavier and flash it on multiple devices. This is an alternative when official clone method is not ready. The idea is to use 'dd' command to dump root file system eMMC partition, but to keep file system consistent, root file system on eMMC should not be used during cloning, so the device should be boot with NFS as rootfs firstly.

Setup NFS server on Host
Here is the guide to setup NFS server.

Copy rootfs to NFS_ROOT
Copy Jetson AGX Xavier sample root file system to NFS root directory. $ sudo cp -prf $JETPACK_ROOT/Xavier/Linux_for_Tegra/rootfs/* /path/of/nfs/root/

Make device boot to NFS
Flash device with below command to make device mount NFS as rootfs. $ cd $JETPACK_ROOT/Xavier/Linux_for_Tegra/ $ sudo ./flash.sh -N :/ --rcm-boot jetson-xavier eth0

Dump rootfs on eMMC
Since now rootfs is NFS, please make sure you have 28GB free space on Host, run below command on board. $ sudo umount /dev/mmcblk0p1 $ sudo dd if=/dev/mmcblk0p1 of=/path/to/rootfs.img

Make sparse image
$ cd $JETPACK_ROOT/Xavier/Linux_for_Tegra/bootloader/ $ sudo ./mksparse -v --fillpattern=0 /path/of/nfs/root/path/to/rootfs.img system.img

FLash device
$ cd $JETPACK_ROOT/Xavier/Linux_for_Tegra/ $ sudo ./flash.sh -r jetson-xavier mmcblk0p1