How to Guide: Cloning a Jetson TX2

I had some difficulty cloning a Jetson, but was able to pull it off. I compiled some steps to help some of you so you don’t have to go through the trouble I did. Happy coding!

  • Put the Jetson you wish to copy from into recovery mode: https://www.youtube.com/watch?v=HaDy9tryzWc
  • On your host machine, enter into the Linux_for_Tegra (or equivalent) directory which has the script “flash.sh” and your various other L4T files.
  • Perform the following command. This will take around 30 minutes.
sudo ./flash.sh -r -k APP -G backup.img jetson-tx2 mmcblk0p1
  • You will now have in your directory two new files: backup.img and backup.img.raw.
    • These files are both quite large, so your file explorer GUI will have difficulty copy and pasting them from one destination to another. The mv command is much more convenient.
  • Make sure your other Jetson TX2 is in recovery mode and attached to your host machine
  • Type the following sequence of commands
  • cd bootloader
    sudo mv system.img ~/Desktop
    sudo mv system.img.raw ~/Desktop
    cd ..
    sudo cp backup.img bootloader/system.img
    sudo cp backup.img.raw booloader/system.img.raw 
    sudo ./flash.sh -r -K kernel/Image -d kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb jetson-tx2 mmcblk0p1
    

    This Jetson should now have all of the files that your other Jetson has on it.

    NOTE:

    These steps are for copying a root file system and all files within. This, however, will NOT change the device tree or the modules included within your newly flashed copy. Changing those is a manual step. There are very many posts here detailing how to implement modules and modify your device tree. Here is an example in implementing SPIDev: https://devtalk.nvidia.com/default/topic/1024806/how-to-enable-spi-spidev-on-28-1-on-target-/

    Thanks a lot for this info. I will add it to my notes.

    Regards,

    -Jafet

    elinux.org has several useful guides like this:
    https://elinux.org/Jetson/TX2_Cloning

    Note that the -d and -K flags are optional, it will select the default ones based off the configuration (jetson-tx2). This can be important if you are using a board other than the standard TX2 devboard.