Clone a jetson xavier nx device fail

I failed to clone a jetson xavier nx image via flash.sh,
I followed sudo ./flash.sh -r -k APP -G xavier.img jetson-xavier mmcblk0p1

and i got Error: Return value 8
Command tegrarcm_v2 --download bct_bootrom br_bct_BR.bct --download bct_mb1 mb1_bct_MB1_sigheader.bct.encrypt --download bct_mem mem_rcm_sigheader.bct.encrypt
*** The [APP] has been read successfully. ***
*** The need signed 0 has been read . ***
*** The tegraid 0x19 has been read . ***
Converting RAW image to Sparse image… mv: cannot stat ‘/home/kevin/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/xavier.img’: No such file or directory
open input file /home/kevin/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/xavier.img.raw failed.

*** The need signed 0 has been read . ***
*** The tegraid 0x19 has been read . *** are echo results

maybe upgrade nvtboot_recovery.bin?
or jetson xavier nx developer kit is not supported?

Did you clone as root or as a regular user? Typically you need to use sudo. Next, do you have enough spare disk space to store the clone? What do you get from:

df -H -T /home/kevin/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/
ls /home/kevin/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/*.img*

I used sudo,
and after df -H -T /home/kevin/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/
I got Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext4 491G 80G 386G 18% /
after ls /home/kevin/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/.img
I got ls: cannot access ‘/home/kevin/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/.img’: No such file or directory

Looks like you have lots of free space so that isn’t an issue.

About:

I may have actually been wrong about location. The location you clone from is where a “.img” and “.img.raw” file are generated. The “Linux_for_Tegra/bootloader/” location is where images are placed when used for flashing. From the location you cloned, was there any “.img” or “.img.raw” file?

About:

During a clone first a raw image is created with a “.img” name, then it is moved to a “.img.raw” filename extension. The “img.raw” content is used to create the new sparse “.img” file. If the “.img” was missing before moving it to a “.img.raw” name, then the clone failed; if the “.img.raw” file exists, but conversion to the sparse file with name “.img” failed, then you would still have a “.img.raw”. Is there any “.img.raw” at your clone location?

Which specific L4T release is this for? I ask because the first R32.x release needed a patch to the flash.sh script.

hi cy_workmail
have you try boardname :jetson-xavier-nx-devkit instead of jetson-xavier?

thanks for helping, I used
sudo ./flash.sh -r -k APP -G xavier_nx.img jetson-xavier-nx-devkit mmcblk0p1
and I got a xavier_nx.img and a xavier_nx.img.raw without error,
but I got warning ‘the image dose not appear to contain a partition table and might not be recongnized or bootable by your device’ when I want to flash the image to my SD card using ‘balenaEtcher’ ,and the SD card cant boot my device finally.
am I wrong somewhere?

L4T release is R32.4.2,and I use
./flash.sh -r -k APP -G xavier_nx.img jetson-xavier-nx-devkit mmcblk0p1 instead jetson-xavier ,
and I got a xavier_nx.img and a xavier_nx.img.raw without error, so I think its the reason for “mv error”: I used wrong parameter and no *img and *img.row was generated before mv.
but I got warning ‘the image dose not appear to contain a partition table and might not be recongnized or bootable by your device’ when I want to flash the generated image to my SD card using ‘balenaEtcher’ ,and the SD card cant boot my device finally.
do you have any advice for this?

you may also consider cloning with dd
dd iif=/dev/mmacblk0 of=/path_to_file

it will result in raw disk image that you could further convert to mksparse image

hi,it’s me again.After faliure with ‘balenaEtcher’ , I tried flash use flash.sh.
and I got something when I use the generated img and flsah.sh to flash:

I used sudo ./flash.sh -r -k APP jetson-xavier-nx-devkit mmcblk0p1,
and I got The [APP] has been updated successfully,

but when I restart xavier ,I got something wrong:
the screen light and off,and always print :
[ok] started session c** of user gdm .
[ok] started user manager for UID 120.
stopping user manger for UID 120.
[ok] stopped user manger for UID 120.
[ok] removed slice user slice of gdm.
[ok] created slice user slice of gdm.
starting user manager for UID 120. …

Here are my steps:
flashed xavier with 32.4.2image,boot xavier and set configurations,
get .img,move it to bootloader and rename to system.img
make xavier on recovery mode, then sudo ./flash.sh -r -k APP jetson-xavier-nx-devkit mmcblk0p1,success
move power of xavier ,then insert power reboot xavier
then the error above appeared.
which step might be wrong?

The UID 120 mention has happened before. See:
https://forums.developer.nvidia.com/t/jetson-tx2-change-kernel-without-full-flash/74029/13
…which leads to:
https://askubuntu.com/questions/1037922/ubuntu-18-04-hangs-on-booting-with-message-started-user-manager-for-uid-120-on

Those notes were from some time back with release R32.1, and your JetPack version 4.4 indicates you are using a newer release. Perhaps it is as simple as being out of disk space.

hi,I followed the first answer ,I press ctrl+alt+F3 to enter the second terminal and check the current status of the disc usage by command df -lh,it’s 18% used,so I reboot and the error is still,can’t boot successfully.
what is ‘./flash.sh -r -k APP jetson-xavier-nx-devkit mmcblk0p1’ changed in system,so that the boot failed?
should I clean SDcard and restart ./flash.sh…?

This flashes the root filesystem to eMMC. None of the other partitions are flashed. If the partitions used with the rootfs are mismatched, then boot will fail. Also, if your flashed rootfs from the clone is too large to fit in the size of the previously created rootfs partition size, then truncation will occur of “something” (it would be hard to predict what gets truncated).

If the flash.sh came from the same release that produced the cloned rootfs, then it should work provided you remove the “-k APP” option. If you fail to remove the “-k APP” option, then it implies all of that surrounding content must already be a match to what is expected. If you skip having “-k APP”, then all of that other content will be freshly installed with the correct release (once again, this assumes the clone is from the same release as the driver package which unpacked the flash.sh tool).

If you used a non-default partition size, then you may want to manually specify the size with the “-S size” option. For a raw clone (you can’t find out this information with a sparse clone), if the size is evenly divisible by 1024 twice, then this is the size in MiB. If evenly divisible three times by 1024, then this is the size in GiB. Example if the clone is exactly 30064771072 bytes, which is divisible twice by 1024 to be 28672MiB, or three times as 28GiB:
‘sudo ./flash.sh -r -S 28GiB jetson-xavier-nx-devkit mmcblk0p1’
(using sudo, and not using “-K APP”)

thanks for your advice,but I have another error when I use sudo ./flash.sh -r -k APP -G xavier_nx_0706.img jetson-xavier-nx-devkit mmcblk0p1,

[ 9.8192 ] Reading partition
[ 9.8224 ] tegradevflash_v2 --read APP /home/kevin/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/xavier_nx_0706.img
[ 9.8249 ] Bootloader version 01.00.0000
[ 9.8422 ] 000000000d0f010e: t read %lu bytes from partition %s.9%
[ 8584.0360 ]
[ 8584.0360 ]
Error: Return value 14
Command tegradevflash_v2 --read APP /home/kevin/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/xavier_nx_0706.img
*** The [APP] has been read successfully. ***
*** The need signed 0 has been read . ***
*** The tegraid 0x19 has been read . ***
Converting RAW image to Sparse image…

and I can still find xavier_nx_0706.img(17.9G) and xavier_nx_0706.img.raw(76.2G)
so, what does the error code mean, is the generated img valid?

What was the purpose of using those options? Unfortunately, I do not know what error code 0x19 is, so someone from NVIDIA will need to look at that.

Basically, if you have a custom rootfs image size, then you want to use the correct “-S” option, but otherwise I recommend flashing all partitions. You can reuse a rootfs image, but I’d simply copy it to the “bootloader/system.img” file name.