Modifying flash_l4t_external.xml for 1TB external NVME and additional user partition

I wish to modify the flash_l4t_external.xml in order to flash 1TB external nvme ssd connected to Orin Nano devkit hosting Orin NX. In addition I wish to add additional partition for user data separated from APP partition.

I did the following changes:

  1. changed device type from external to nvme and num_sectors to 2147483648 (1TB)
  2. changed APPSIZE to 274877906944 (256GB)
  3. Added a new partition:

partition name=“USER” type=“data”>
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
size> 274877906944 /size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x808 </allocation_attribute>
<align_boundary> 4096 </align_boundary>
<percent_reserved> 0 </percent_reserved>
description> user data /description>

This is the new xml:
flash_l4t_external_new.xml (10.1 KB)

I get the following error without the target booting up:

ERROR: PARTUUID=e671dd75-87ca-4529-87c1-6d8bea4bc845 mount fail…

boot log:
boot.log (116.0 KB)

The flash command:
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1
-c tools/kernel_flash/flash_l4t_external_new.xml
-p “-c bootloader/t186ref/cfg/flash_t234_qspi.xml --no-systemimg”
–showlogs --network usb0 jetson-orin-nano-devkit external

In my xml there are no id fields to the partitions.
I added id=“1” to APP partition because i used nvme0n1p1 in my flash command.

this is the new xml:
flash_l4t_external_new.xml (10.2 KB)

now the system boots but I can’t see the USER partition, the APP partition size is not 256GB and the system created for me a default user account named ubuntu.

for some reason it ignores my xml.

flash log:
flash.log (273.5 KB)

Hi,

can you check if the partition is indeed created?

If it does exist, then you need to modify /etc/fstab so the system will automatically mount it upon boot.

no its not. The additional partition is not created and the APP partition size is not 256GB as I indicated in the xml

Hi,

can you cd into /dev/disk/by-partlabe and put the result of ll here?
Also, can you flash with the default layout file, and add a -S 256GiB option to the flashing command to see if the size is correct if flashed in this way?

Yes, I’ll be able to do it next week and update

1 Like

You asked me for 2 different things so I answer them in separate:

  1. can you cd into /dev/disk/by-partlabe and put the result of ll here?:

a. flash command:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external_new.xml -p “-c bootloader/t186ref/cfg/flash_t234_qspi.xml” --showlogs --network usb0 jetson-orin-nano-devkit external

(with my xml attached above)

b. command output:

ubuntu@ubuntu-desktop:~$ cd /dev/disk/by-partlabel/
ubuntu@ubuntu-desktop:/dev/disk/by-partlabel$ ll
total 0
drwxr-xr-x 2 root root 320 Aug 6 10:09 ./
drwxr-xr-x 8 root root 160 Aug 6 10:09 …/
lrwxrwxrwx 1 root root 15 Aug 6 10:09 APP → …/…/nvme0n1p1
lrwxrwxrwx 1 root root 16 Aug 6 10:09 esp → …/…/nvme0n1p11
lrwxrwxrwx 1 root root 16 Aug 6 10:09 esp_alt → …/…/nvme0n1p14
lrwxrwxrwx 1 root root 15 Aug 6 10:09 kernel → …/…/nvme0n1p2
lrwxrwxrwx 1 root root 15 Aug 6 10:09 kernel_b → …/…/nvme0n1p5
lrwxrwxrwx 1 root root 15 Aug 6 10:09 kernel-dtb → …/…/nvme0n1p3
lrwxrwxrwx 1 root root 15 Aug 6 10:09 kernel-dtb_b → …/…/nvme0n1p6
lrwxrwxrwx 1 root root 15 Aug 6 10:09 recovery → …/…/nvme0n1p8
lrwxrwxrwx 1 root root 16 Aug 6 10:09 recovery_alt → …/…/nvme0n1p12
lrwxrwxrwx 1 root root 15 Aug 6 10:09 recovery-dtb → …/…/nvme0n1p9
lrwxrwxrwx 1 root root 16 Aug 6 10:09 recovery-dtb_alt → …/…/nvme0n1p13
lrwxrwxrwx 1 root root 16 Aug 6 10:09 RECROOTFS → …/…/nvme0n1p10
lrwxrwxrwx 1 root root 15 Aug 6 10:09 reserved_for_chain_A_user → …/…/nvme0n1p4
lrwxrwxrwx 1 root root 15 Aug 6 10:09 reserved_for_chain_B_user → …/…/nvme0n1p7

  1. Also, can you flash with the default layout file, and add a -S 256GiB option to the flashing command to see if the size is correct if flashed in this way?

a. flash command:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -S 256GiB -c tools/kernel_flash/flash_l4t_external.xml -p “-c bootloader/t186ref/cfg/flash_t234_qspi.xml” --showlogs --network usb0 jetson-orin-nano-devkit external > flash.log 2>&1

(with regular flash_l4t_external.xml)

b. flashing process failed. flash log:
flash.log (151.6 KB)

Thanks again

Hi,

is the num_sectors variable also reset to the default value?
Does pre-formatting the SSD before flashing make any difference?
Also provide the UART log during flashing here.

I apologise but how can I verify what you asked?

  1. Where to check the num_sectors variable after flashing?
  2. I provided the flashing log when using the -S flag with the “regular” flash xml file.

Following are the flashing logs when using my xml file (from previous reply):
command output:

flash.log (273.8 KB)

UART flash+boot:
uart.log (259.0 KB)

The command I used:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external_new.xml -p “-c bootloader/t186ref/cfg/flash_t234_qspi.xml” --showlogs --network usb0 jetson-orin-nano-devkit external > flash.log 2>&1

Thank you

I don’t mean checking it after flashing. I mean the xml layout file used during flashing.

So the situation is, when your owned layout file is used, the flashing ends successfully, but you don’t get the extra partition you want, and the size of the APP partition is also not 256GB as specified.

If the default layout file is used, the flashing fails with -S 256 GiB. Is that right?

How large is it if it’s not 256GB?

You right:

  1. If I use the default layout with the -S 256 GiB flag - the flashing process fails. I attached the log in my previous replies.
  2. If I use my layout, I don’t see any changes even tough the flashing process ends successfully. The APP partition size remains as before the flashing.

Then how about this?

The APP partition size remains as before the flashing.

For example:

  1. I flashed using the flash_l4t_external.xml layout.
  2. During initial system setup I configured the APP size to ~1TB . The initial setup via GUI asked me to choose the APP size.
  3. I flashed using the flash_l4t_external_new.xml layout
  4. I see no changes from previous layout. APP size remains ~1TB
  5. If I had chose another APP size in step 2 then I would get it in step 4. It just remains the same.

For some reason it ignores my layout.

Then can you try running

Linux_for_Tegra/tools/l4t_create_default_user.sh -u <username> -p <password>

before flashing?
The OEM config upon first boot will be skipped.

before flashing with my layout or with the default one?

Try both and see how it goes.

So just to make sure we are on the same page here, I’m going to perform the following actions:

  1. create some default user
  2. execute:

sudo ./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 jetson-orin-nano-devkit external > flash.log 2>&1

(default layout)

  1. execute:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external_new.xml -p “-c bootloader/t186ref/cfg/flash_t234_qspi.xml” --showlogs --network usb0 jetson-orin-nano-devkit external > flash.log 2>&1

(my layout)

  1. publish here command output + uart output for steps 2,3

am I right?

Yes, and also check what partitions you get if the flash ends successfully.

Hi,

one more question here.

Can you try changing num_sectors to 2147483648 in the default layout file, leaving other things as default values, and flash again with -S 256 GiB?
Maybe the size of your NVMe drive is not correctly detected by the flashing script, or the script first reads the -S option, and then finds the size of the drive afterwards so it fails. (The default layout file is only 57GB)

Regarding the customized partition, I’ll check with our internal team to see if made the right way doing it.

  1. The commands I executed:
    commands (6.1 KB)

(flashing including checking partitions)

  1. log files:
    default_layout_uart.log (258.1 KB)
    new_layout_uart.log (259.1 KB)
    flash_default_layout.log (285.4 KB)
    flash_new_layout.log (273.7 KB)