Cloning across different tx2's

I have tried to use the cloning procedure in: https://devtalk.nvidia.com/default/topic/1000105/ to clone the root partition of one TX2 into a second one, and it works fine as far as I can see.

Is there particular concerns regarding to cloning between different units? One issue I can think of is that the two units should have the same partition layout, but I am curious as to what would happen if I try clone a larger image into a smaller partition.

The APP partition is the first partition. Normal install places a lot of other partitions directly following this. If you were to put a larger partition in, then I think something would either be truncated or overrun. Failure is likely.

There is some ability in a GPT partition scheme to reorder labels so far as the number used with a partition, but I’m not sure if this could be applied in this case…very likely the larger partition would always fail.

You also want the other partitions to be from the same release, so for example you wouldn’t want to clone R27.1 rootfs and put it in an R28.2 pre-release.

If you cover a cloned raw partition file with loopback you can use gparted to manipulate the loopback device to resize your clone as if it were a real disk (you’d have to reduce it unless you are willing to pad the end of the file with NULL bytes first…then you could also increase the size…any pad would need to be a multiple of the block size…e.g., 512 bytes at a time for most disks).

Resize with Gparted is an interesting idea. Also, is it possible to use that flash.sh to flash the entire disk rather than a single partition?

A normal flash does flash everything. A flash which is normal other than “reusing” the rootfs also flashes everything…it just doesn’t regenerate the system.img (if you had a clone in place then it would use this in that case). There are many partitions other than just the rootfs which people don’t normally think about.

I think I should have asked this question in my last post: is there a way to clone the entire eMMC disk, and then flash it?

Not using the flash.sh utility. There was in the older TK1, and I really liked this (hint! cloning whole eMMC and cloning by offset would be a very very popular feature). To clone the whole disk on a TX2 you would have to boot to an alternate file system, e.g., on SD card or SATA drive, and then use dd. Note that flashing with flash.sh would not necessarily be able to use such a clone, but on a host a complete dd copy can have individual partitions extracted from it via dd. I think the real trick for a real and true backup and restore would include the leading space on the disk which is part of the GPT layout and not directly part of individual visible partitions.

So my advice if you want to do this is create an SD card rescue, select this during boot with the serial console, and then dd to a SATA drive (or USB thumb drive).