Hi,

I have a Jetson Orin NX with a NVME. I am planning on using Yocto and Mender to handle A/B OTA.

The stock partition layout has the UDA partition flash_l4t_t234_nvme_rootfs_ab.xml has the UDA in position 15. But since it’s before reserved and APP it’s impossible to grow that partition after flashing the device.

Without moving the UDA partition the flash works with my provided xml. But if I put the partition at the end like in the example attached the flashing process using ./initrd-flash fails always at the same point.

Creating partitions
  [03] name=A_kernel start=0 size=262144 sectors
  [04] name=A_kernel-dtb start=0 size=1536 sectors
  [05] name=A_reserved_on_user start=0 size=64768 sectors
  [06] name=B_kernel start=0 size=262144 sectors
  [07] name=B_kernel-dtb start=0 size=1536 sectors
  [08] name=B_reserved_on_user start=0 size=64768 sectors
  [09] name=recovery start=0 size=163840 sectors
  [10] name=recovery-dtb start=0 size=1024 sectors
  [11] name=esp start=0 size=131072 sectors
  [12] name=recovery_alt start=0 size=163840 sectors
  [13] name=recovery-dtb_alt start=0 size=1024 sectors
  [14] name=esp_alt start=0 size=131072 sectors
  [16] name=reserved start=0 size=982016 sectors
  [01] name=APP start=0 size=32374784 sectors
  [02] name=APP_b start=0 size=32374784 sectors
  [15] name=UDA start=0 size=819200 sectors
Writing partitions
  Writing boot.img (size=46986670) to /dev/sda3 (size=134217728)...
  Writing kernel_tegra234-p3768-0000+p3767-0000-nv.dtb (size=253358) to /dev/sda4 (size=786432)...
  Writing boot.img (size=46986670) to /dev/sda6 (size=134217728)...
  Writing kernel_tegra234-p3768-0000+p3767-0000-nv.dtb (size=253358) to /dev/sda7 (size=786432)...
  Writing esp.img (size=67108864) to /dev/sda11 (size=67108864)...
ERR: unmount /media/squaremind/data
/media/squaremind/data1 on device /dev/sda1 failed
ERR: device unmount failed
Error powering off drive: The drive in use: Device /dev/sda16 is mounted (udisks-error-quark, 14)
Error powering off drive: The drive in use: Device /dev/sda16 is mounted (udisks-error-quark, 14)
Error powering off drive: The drive in use: Device /dev/sda16 is mounted (udisks-error-quark, 14)
ERR: write failure to external storage at 2024-12-10T18:45:56+01:00

I have disabled automount, checked dmesg there is no issue with usb.

Thanks for the help.

log.txt (180.5 KB)
custom_layout.xml.txt (10.3 KB)
log_x.txt (230.8 KB)

I also tried with the <allocation_attribute> 0x808 </allocation_attribute> in UDA so it grows the partition automatically but it fails at the same point.

log_0x808.txt (180.5 KB)

hello austriker85,

may I know what’s your real use-case?

Yes,

I am using the Jetson Orin NX to stream data. The data is stored in the permanent /data storage and with other elements like

I want 16GB for each Rootfs A and B and the rest for data. The NVMe size is 480GB.

For OTA management I am using yocto and Mender. At first boot mender triggers a script to expand the UDA partition to the rest of the disk. meta-mender/meta-mender-core/recipes-mender/mender-client/files/mender-resize-data-part.sh.in at 15ee7d06f1e6dcf5ca0a834d7c52cc4fa3b4a860 · mendersoftware/meta-mender · GitHub

But it fails since the UDA is inbetween partitions:

$ fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 447.13 GiB, 480103981056 bytes, 937703088 sectors
Disk model: SFPC480GM1AR2MT-I-7C-22H-STD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 05F3730C-62C9-4B6F-BB43-7DE9AAB52B94

Device             Start      End  Sectors   Size Type
/dev/nvme0n1p1   3057664 35432447 32374784  15.4G Microsoft basic data
/dev/nvme0n1p2  35432448 67807231 32374784  15.4G Microsoft basic data
/dev/nvme0n1p3      2048   264191   262144   128M Microsoft basic data
/dev/nvme0n1p4    264192   265727     1536   768K Microsoft basic data
/dev/nvme0n1p5    266240   331007    64768  31.6M Microsoft basic data
/dev/nvme0n1p6    331776   593919   262144   128M Microsoft basic data
/dev/nvme0n1p7    593920   595455     1536   768K Microsoft basic data
/dev/nvme0n1p8    595968   660735    64768  31.6M Microsoft basic data
/dev/nvme0n1p9    661504   825343   163840    80M Microsoft basic data
/dev/nvme0n1p10   825344   826367     1024   512K Microsoft basic data
/dev/nvme0n1p11   827392   958463   131072    64M EFI System
/dev/nvme0n1p12   958464  1122303   163840    80M Microsoft basic data
/dev/nvme0n1p13  1122304  1123327     1024   512K Microsoft basic data
/dev/nvme0n1p14  1124352  1255423   131072    64M Microsoft basic data
/dev/nvme0n1p15  1255424  2074623   819200   400M Microsoft basic data
/dev/nvme0n1p16  2074624  3056639   982016 479.5M Microsoft basic data

That’s why I want to put the UDA partition at the end. And based on the partition docs I actually don’t need to use the grow the partition if I use the allocation 0x808

Mender provides a .dataimg for the UDA partitition with elements like encryption keys etc…

hello austriker85,

just an FYI,
UDA partition is reserved by NV for OTA process. and, the UDA partition size to be a multiple of 512 bytes.
please see-also Topic 223250 for reference.

Hello Jerry,

Thank you for your feedback. I actually created a new partition and the flash process worked like a charm.

May I suggest to change the description of the partition:

        <partition name="UDA" type="data">
            <allocation_policy> sequential </allocation_policy>
            <filesystem_type> basic </filesystem_type>
            <size> 419430400 </size>
            <file_system_attribute> 0 </file_system_attribute>
            <allocation_attribute> 8 </allocation_attribute>
            <percent_reserved> 0 </percent_reserved>
            <align_boundary> 16384 </align_boundary>
            <description> **Required.** This partition may be mounted and used to store user
              data. </description>
        </partition>

Put something like reserved for Nvidia instead of the current blurry description.

Cheers

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