Flash custom data partition with l4t_initrd_flash.sh - No space left on device

I’m currently working on flashing a Jetson Orin NX device with ROOTFS_AB enabled using the l4t_initrd_flash.sh script. In addition to the rootfs A/B setup, I’m also including a custom data partition. To achieve this, I’ve made some modifications to the flash_l4t_nvme_rootfs_ab.xml partition layout to accommodate the custom data partition.

The flashing process was successful initially. However, I encountered an issue when the combined size of the data partition and rootfs A exceeded the size of the External APP partition. Specifically, during the “Making system.img” step, I received an error stating “No space left on device.” This occurred because the /dev/loopXX device within L4T/bootloader/mnt became full.

I’m wondering if anyone has encountered a similar issue and knows of a workaround to separate the data and rootfs partitions during the flashing process to avoid this error.

So how large is your custom data partitin?
Have you tried modifying num_sectors in flash_l4t_nvme_rootfs_ab.xml?

Hi @DaveYYY,
thanks for looking into it.
For partitioning purposes, the rootfs partitions A and B are allocated approximately 25 GB each, while the data partition is allocated around 420 GB. The flash image sizes are roughly 12 GB for both rootfs partitions A and B, and approximately 40 GB for the data partition.

To configure the number of sectors, I utilize the l4t_initrd_flash.sh script and set num_sectors to 976562499:

sudo EXT_NUM_SECTORS=976562499 ./tools/kernel_flash/l4t_initrd_flash.sh \
-S 25GiB \
--external-device nvme0n1p1 \
-c $FLASH_DIR/scripts/flash_l4t_nvme_rootfs_ab.xml \
-p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
--showlogs \
--network usb0 \

Then what does your flash_l4t_nvme_rootfs_ab.xml look like now?

Put the full log here.

Thanks, i appended the flash_l4t_nvme_rootfs_ab.xml and the full log.

flash_l4t_nvme_rootfs_ab.xml (11.2 KB)
log.txt (103.5 KB)

Then will it work if you don’t put your pre-built uda_ext4.img?

The uda_ext4.img is pre-build and located in the folder Linux_for_Tegra/bootloader/uda_ext4.img.

I mean whether it works if you remove the image from your partition layout:

<filename> uda_ext4.img </filename>

Sorry for the misunderstanding.
Yes it works in the following scenarios:

  • Remove uda_ext4.img in the partition layout
  • If uda_ext4.img + rootfs partition <= External APP partition S (which is currently 25 GiB)

What’s the full physical size of your NVMe SSD?
For your use case, you should specify 40GiB for -S parameter.

Please also modify the following line in partition layout to configure 420 GB for user data (UDA) partition.

        <partition name="UDA" type="data">
            <allocation_policy> sequential </allocation_policy>
            <filesystem_type> basic </filesystem_type>
-           <size> 18432 </size>
+           <size>  450971566080 </size>
            <file_system_attribute> 0 </file_system_attribute>
            <allocation_attribute> 0x808 </allocation_attribute>
            <percent_reserved> 0 </percent_reserved>
            <filename> uda_ext4.img </filename>
            <description> **Required.** Automatically takes all remaining space on the device except that
              occupied by the `secondary_gpt` partition. Allocation attribute must be set to 0x808.
              May be mounted and used to store user data. </description>

I would suggest you just adding ROOTFS_AB=1 to enable redundancy rootfs (determined by board config) instead of specifying the partition layout file.

thanks for the detailed answer.

i implemented the suggested changes:

  • set ROOTFS_AB=1
  • set <size> attribute of UDA to 450971566080
  • set -s parameter to 40 GiB

I successfully flashed the device, including the data partition. The only drawback is that now my rootfs size is now 40 GiB instead of 25 GiB. Do i have to specify it in the partition table? Additionally could you please explain in detail what impact the -s parameter has.

-S is used to specify the rootfs size.
I thought you mean 12GB+25GB approximately 40GB so that suggesting you configure it with 40 GiB.
You can also specify -S 25GiB in your flash command to make both APP and APP_b partition size to be 25GB.

Sorry for the confusion, let’s clarify it:
I want to flash the device with a rootfs size of 25GB.
I discovered that i can flash it successfully if (rootfs size+data partition size) <=-S

I just executed the same command with -S 25GiB and i got the same error as before (no space left on device).

It means your rootfs need more spaces, (i.e. 25GiB is not enough for rootfs).
Is there any concern if you use 40GiB for rootfs?

The rootfs partition is only ~10GB, so 25GB should be more than enough.
Yes I need the available space on the data partition.

what’s the size of your system.img.raw?

The file doesn’t exist because the script fails before.
The file system.img exist (size: 26843545600).

It maps to 25GiB, I would suggest you just using the larger size for the space not enough issue since you have enough space in NVMe for both rootfs A/B.

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