Can not restore nvme with Orin Nano

I am trying backup and restore functions on my custom board, the module is Jetson Orin Nano 8G, jetpack is 5.1.1.
I use the following command to flash my board
sudo BOARDID=3767 BOARDSKU=0003 ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 p3509-a02+p3767-0000 nvme0n1p1
Then, I use the following command to backup
sudo ./tools/backup_restore/l4t_backup_restore.sh -b p3509-a02+p3767-0000
No problems until this step, I formatted the nvme on the custom board to ext4, and then restored nvme using the following command
sudo ./tools/backup_restore/l4t_backup_restore.sh -r p3509-a02+p3767-0000
It fails with partx: specified range <1:0> does not make sense
I have tried several times to restore, and replaced the USB cable, but it doesn’t work, can anyone help?
Here is some logs
flash_log.txt (92.1 KB)
device_log.txt (82.0 KB)
PS:I have changed mmcblk0 to nvme0n1 in nvrestore_partitions.sh and nvbackup_partitions.sh, changed mmcblk0p1 to internal in l4t_backup_restore.sh, before I did the restore and backup.

Apply this patch:

diff --git a/scripts/backup-restore/nvrestore_partitions.sh b/scripts/backup-restore/nvrestore_partitions.sh
index 78ae589..695a700 100755
--- a/scripts/backup-restore/nvrestore_partitions.sh
+++ b/scripts/backup-restore/nvrestore_partitions.sh
@@ -313,10 +313,18 @@
 			echo "${SCRIPT_NAME} Checksum of ${FIELDS[2]} does not match the checksum in the index file."
 			exit 1
 		fi
-		# partx delete must be called before flashing, and partx add after flashing.
-		partx -d "/dev/${INTERNAL_STORAGE_DEVICE}"
+		# Delete previous GPT if it exists.
+		if partx -s "/dev/${INTERNAL_STORAGE_DEVICE}" >/dev/null 2>&1; then
+			partx -d "/dev/${INTERNAL_STORAGE_DEVICE}"
+		fi
+		# Flash GPT image, refresh and validate.
 		dd if="${FIELDS[1]}" of="/dev/${INTERNAL_STORAGE_DEVICE}"
+		sync
 		partx -v -a "/dev/${INTERNAL_STORAGE_DEVICE}"
+		if ! partx -s "/dev/${INTERNAL_STORAGE_DEVICE}" >/dev/null 2>&1; then
+			echo "Error: GPT does not exist on the /dev/${INTERNAL_STORAGE_DEVICE}"
+			exit 1
+		fi
 		GPT_EXISTS=true
 		break
 	fi

Or manually download 35.5 and replace Linux_for_Tegra/tools/backup_restore/ with the one you get in the 35.5 BSP.

2 Likes

Thanks for your solution, I’ll test it later.

The nvme restore works fine, awesome!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.