image clone about tx2 with JetPack 3.0

Hello!
I want to clone the image of tx2 to a host PC.
I referred here and change the flash.sh file with a patched one including -G option.

However, when I run the command
$ sudo ./flash.sh -r -k APP -G my_backup.img jetson-tx2 mmcblk0p1
The terminal shows
“sudo: ./flash.sh: command not found”
Did someone meet the same problem?

I would use dd to create a raw image clone of the entire disk storage of Jetson.
However, all entries of lsblk output should be cloned.

lsblk

perhaps it would take to execute from Jetson:

dd if=/dev/mmcblk0 | ssh user@hostpcipaddr dd of=mmcblk0.raw

or from Host PC

ssh nvidia@jetsonip "dd if=/dev/mmcblk0" | dd of=mmcblk0.raw

It seems you are running flash.sh from a folder where flash.sh binary is not represented.
You may locate at the Host PC the file flash.sh :

locate flash.sh

if locate package is not installed :

sudo apt-get install mlocate
sudo updatedb
locate flash.sh

then navigate to the folder with the file and try run it with ./flash.sh from thre

@Andrey1984 Thank you very much!
I confirmed as what you said.
Since I made another flash.sh, I had no authority to run the file.
Thank you!

FYI, flash.sh is from the driver package (JetPack downloads and runs the driver package for you when using JetPack…I tend to just use the driver package directly on command line most of the time). The patch for clone was for earlier versions of L4T (driver package plus sample rootfs implies NVIDIA drivers on top of ordinary Ubuntu…this is the L4T version). JetPack3.1 provides L4T R28.1 (the R28.1 driver package plus Ubuntu 16.04 sample rootfs) and does not need patching to clone.

To see which L4T version is on a given Jetson:

head -n 1 /etc/nv_tegra_release

When the driver package is present there will be a “Linux_for_Tegra/” subdirectory, and flash.sh is in that. You need root permission to use loopback, so most flash.sh operations require it to be called with “sudo”. Don’t forget to check disk space before cloning or flashing since this requires a lot of space (e.g., “df -H”).