Any fast way for cloning AGX Xavier?

I have a dozen Xavier’s to set up and configure, and I was hoping that I’d have to do it only for the first one and then clone that to the remaining computers. Is there an effective way to do this?
I checked using NVMe as boot drives, but that still seems very hacky.
How would you approach this problem if you had 100 Xavier’s dev boards to prepare?

1 Like

On your host PC which has performed a flash you will find this directory which contains the flash software:
~/nvidia/nvidia_sdkm/JetPack...version.../Linux_for_Tegra/

This contains the “flash.sh” script (JetPack/SDKM is just a front end, and these lower level scripts are what actually perform a flash…or a clone).

If your AGX is in recovery mode and has the USB-C connected, then this would create a clone (beware this takes a lot of disk space on the host PC, you should probably have about 50GB spare before you start):
sudo ./flash.sh -r -k APP -G my_backup.img jetson-xavier mmcblk0p1
(note that you would change “jetson-xavier” if the model is different, e.g., a commercial module would have a different name versus a dev kit model, but the carrier board won’t matter)

The above would produce two files:

  • my_backup.img, a “sparse” file;
  • my_backup.img.raw, a “raw” file.

Both files can be used for flashing, and the sparse file is smaller, so it is faster at flashing. A raw file can be used to create a smaller sparse file using the “mksparse” program with a NULL fill parameter.

Only the raw file can be loopback mounted, edited, examined, so on. I normally throw away the sparse file, and when no longer working with the raw file I will run bzip2 -9 on it (takes a very long time to copy such a large file, or to compress it).

Regardless of which clone you use, if you replace “Linux_for_Tegra/bootloader/system.img” with this clone, and then tell flash.sh flash, but to not generate the system.img, it will then use your exact image. There are other changes you need if this is not a dev kit booting from eMMC, but basically the “-r” option takes care of reusing system.img and not overwriting it with a newly generated image. For example:
sudo ./flash.sh -r jetson-xavier mmcblk0p1

3 Likes

Thanks you so much! A very brief and clear answer that contains all I needed to know!

Do you think it is possible to plug multiple Xaviers to my pc and run flash.sh 5 times in parallel? I don’t have the boards yet for testing, but that would be a major time saver.

I doubt that anything other than the mass flash utility would work for this, but that is something I have not experimented. In terms of using the regular flash simultaneously there is likely no method for the software to identify and work with a particular Jetson. Someone else would need to comment on using single flash software simultaneously for multiple Jetsons.

Just chipping in the device name table, for correctly setting clone and flash parameters, according to the flash documentation

EDIT: for some reason, on the AGX Xavier, using jetson-agx-xavier-devkit as <BOARD> in the parameter list does not work. Only jetson-xavier does. Anyone knows why the official device name is not accepted as a parameter?