Cant write backup image to TX1

Hi everyone,

I have the following problem:
I clone the system.img of the Tegra X1 every week. Then I wanted to install the latest tools with JetPack 2.3, which didn’t work. Some Libs were misssing to install Cuda 8. (cuda-toolkit-8-0 libgompl libfreeimage-dev libopenmpi-dev open-bin ).

So I decided to flash the whole Tegra with Ubunu 16.04, and so far, all worked fine - full installation of CUDA, Vision Works, Open CV. But with this JetPack, the system.img files have a size of 15.0 GB (15.032.385.536 Bytes). The tegra has additional partitions with about 300 MB. My old backups, before JetPack 2.3, have all the size of 15.3 GB ( Bytes).

So I can’t write my old backups to the tegra, since the size of the target is too small.
What can I do now? I want my old system with 15.3 GB on the Tegra.


The image will always have to be an exact byte size which is a multiple of 1024. When flashing with “-S 14GiB”, the image will be exactly “14102410241024" bytes. If using “-S 14580MiB”, the image must be exactly "145801024*1024” bytes (this matches the byte size you gave, so the cloned image you call 15.3GB was produced with flash using “-S 14580MiB”). Actually restoring your clone might defeat the purpose of having upgraded to get more dependencies…restoring a clone will erase your package updates.

The other partitions are hidden, and needed. I do not know if they vary in size across different L4T release versions, but if they do change, then so does the starting offset of the root partition. Should your root partition image fit in remaining space, then chances are the image will work. I don’t know if clone restore actually pays attention to a “-S” parameter, but you might want to copy your clone into “bootloader/system.img”, then flash (be careful to use “-r” so as to not overwrite your image):

<s>sudo ./ -r -S 14580MiB mmcblk0p1 jetson-tx1</s>
sudo ./ -r -S 14580MiB jetson-tx1 mmcblk0p1

Keep in mind that if you want to you can also loopback mount the image, then copy it into the same location sample rootfs would have gone (e.g., “sudo mount -o loop ./clone.img /mnt”, then use “sudo cp -adpR” or rsync to put a copy of this into “Linux_for_Tegra/rootfs/”). Should you do this, everything except for the boot files would match that cloned image. Since you don’t want to flash, this is only a backup plan.

Also note that on your host you can use something like gparted to resize the clone image if you first cover the image with loopback, and then run gparted on the loopback device special file. You would need to resize such that it follows the exact byte size rules listed above for multiples of 1024. In a similar manner you could also create an empty file of the exact desired size, then format it as ext4 under loopback, and recursively copy or rsync from the original cloned image onto that new loopback covered file to use this as a restore image.

Thanks for your answer. First, I received the message “Invalid target board”. After checking ,

I made

sudo ./

before, then sudo ./ -r -S 14580MiB mmcblk0p1 jetson-tx1
which also ended in “Inavlid target board”. After checking the Quick Start Guide, I noticed I have to change the order of the command to

sudo ./ -r -S 14580MiB jetson-tx1 mmcblk0p1

like mentioned in one of your previous posts

The host is now writing my backupfile to the TX1, which is currently in /bootloader/system.img

I succeeded with this. Thanks again!


Thanks, I see I switched the command line argument order in the example; I’ve edited the original to show this corrected flash command. Just be careful to not lose your backup…if you ever run without “-r” it’ll be overwritten.

To avoid loosing my backups, their names are unique. I include the date to the filename, for example system-2016-10-26. When I want to clone a backup, I rename it to system.img