Resize rootfs partition on Jetpack 6

I have AGX Orin 64 GB developer kit. I was able to use JetPack 5 and configure the Orin to have 35 GB for the main RootFS and use the rest for other partition. I did it by running “./flash.sh -S 35GiB jetson-agx-orin-devkit mmcblk0p1”. Then when the Jetson Linux is configured, it has a screen to set the APP partition size, and I provided the 35 GiB size. When the OS started, I can see the size of /dev/mmcblk0p1 to be 35 GiB and it has other partition as /dev/mmcblk0p16. However, with JetPack 6.0, I run the same flash.sh command with -S option, the OS did not have the screen to specify the APP partition anymore. The /dev/mmcblk0p1 is taking the entire size of the disk. I verified it on the gparted GUI. So there is a differences in Jetpack 6 vs Jetpack 5. Is it a bug in Jetpack 6 or there is some configuration I need to do? Thanks.

hello james.dinh,

could you please give it a try to revise ROOTFSSIZE=55GiB; within p3701.conf.common for confirmation?

Hi Jerry,
I forgot to mention that I did revise the value of ROOTFSSIZE in the common file to match the -S parameters in the flash.sh script but it did not work in JP 6. The same process worked in JP 5. It seems like JP 6 has removed the screen to provide the APP partition size when the Jetson Linux OS is initially configured after a flash.

To clarify:
In JP 5, I must configure three things: (1) change ROOTFSSIZE in common file, (2) provide the -S parameters, (3) provide APP partition size for it to work.

hello james.dinh,

we’ve tested with -S options to resize rootfs, and it has worked normally.
for instance, $ sudo ./flash.sh -S 45GiB jetson-agx-orin-devkit internal
here’re more details for your reference.

$ head -1 /etc/nv_tegra_release 
# R36 (release), REVISION: 3.0, GCID: 36191598, BOARD: generic, EABI: aarch64, DATE: Mon May  6 17:34:21 UTC 2024
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1   44G  6.5G   36G  16% /

The issue is that “df -h” returns:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p1 24G 6.8G 16G 31% /
tmpfs 31G 120K 31G 1% /dev/shm
tmpfs 13G 27M 13G 1% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 6.2G 224K 6.2G 1% /run/user/1000

However,
sudo fdisk -l
Disk /dev/loop0: 16 MiB, 16777216 bytes, 32768 sectors
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: dos
Disk identifier: 0x00000000

Disk /dev/mmcblk0: 59.28 GiB, 63652757504 bytes, 124321792 sectors
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: 79BB33CE-7DB6-41F7-B4D3-A20E6F60FB33

Device Start End Sectors Size Type
/dev/mmcblk0p1 3050048 124321751 121271704 57.8G Microsoft basic data
/dev/mmcblk0p2 40 262183 262144 128M Microsoft basic data
/dev/mmcblk0p3 262184 263719 1536 768K Microsoft basic data
/dev/mmcblk0p4 263720 328487 64768 31.6M Microsoft basic data
/dev/mmcblk0p5 328488 590631 262144 128M Microsoft basic data
/dev/mmcblk0p6 590632 592167 1536 768K Microsoft basic data
/dev/mmcblk0p7 592168 656935 64768 31.6M Microsoft basic data
/dev/mmcblk0p8 656936 820775 163840 80M Microsoft basic data
/dev/mmcblk0p9 820776 821799 1024 512K Microsoft basic data
/dev/mmcblk0p10 821800 952871 131072 64M EFI System
/dev/mmcblk0p11 952872 1116711 163840 80M Microsoft basic data
/dev/mmcblk0p12 1116712 1117735 1024 512K Microsoft basic data
/dev/mmcblk0p13 1117736 1248807 131072 64M Microsoft basic data
/dev/mmcblk0p14 1248832 2068031 819200 400M Microsoft basic data
/dev/mmcblk0p15 2068032 3050047 982016 479.5M Microsoft basic data

/dev/mmcblk0p1 size is 57.8GiB. Should be 24GiB as the size I used in the flash command & common file. I cannot resize the root partition as it is in use. That is the difference between JetPack 6 vs JetPack 5. Please help!

could you please also compare the results with $ df -h and $ sudo fdisk -l on JP-5 for reference?

Here are the output for the Orin using JetPack 5:

df -h
Size
/dev/mmcblk0p1 35G
/dev/mapper/enc 23 G
*** Notes: I use one partition (23 G) for the encrypted partition

fdisk -l
Size
/dev/mmcblk0p1 35G
/dev/mmcblk0p16 22.8G
**** Notes: After flash I can see the OS creates /dev/mmcblk0p16, that is the partition after I used 35 GB for the rootfs. This does not happen in JetPack 6

could you please update with this command-line to flash the device, it locate the rootfs partition through the PARTUUID.
for instance, $ sudo ./flash.sh -S 35GiB jetson-agx-orin-devkit internal

I’ve tried both:
sudo ./flash.sh -S 35GiB jetson-agx-orin-devkit mmcblk0p1
and
sudo ./flash.sh -S 35GiB jetson-agx-orin-devkit internal

They both have same effect on JetPack 6.

Jerry,
Would you look into why Jetson Linux in JetPack 6 remove the “APP Partition Size” GUI for the System Configuration when configuring the Operating System. Would that have the impact on what I am seeing in JetPack 6.

You can use gparted to resize the partition after flashing

or

Before flashing you can modify the APP partition allocation_attribute to 0x8

Linux_for_Tegra/bootloader/generic/cfg/flash_t234_qspi_sdmmc.xml

   <partition name="APP" id="1" type="data">
        <allocation_policy> sequential </allocation_policy>
        <filesystem_type> basic </filesystem_type>
        <size> 42949672960 </size>
        <file_system_attribute> 0 </file_system_attribute>
        <allocation_attribute> **0x8** </allocation_attribute>
        <align_boundary> 16384 </align_boundary>
        <percent_reserved> 0 </percent_reserved>
        <unique_guid> 08f6509e-254e-4924-b881-d394f73e8f92 </unique_guid>
        <filename> system.img </filename>
        <description> **Required.** Contains the rootfs. This partition must be assigned
          the "1" for id as it is physically put to the end of the device, so that it
          can be accessed as the fixed known special device `/dev/mmcblk0p1`. </description>
    </partition>
1 Like

That update brings back the APP Partition size screen and resolves my issue. Thank you for your help!

Another related question about restore and backup the image on an Orin when it has custom APP Partition Size. I have the Orin A that has APP Partition size of 35 GiB, I create a backup image from it using “sudo ./flash.sh -r -k APP -G orin_backup.img jetson-agx-orin-devkit mmcblk0p1”, I then use that image and restore on Orin B using “sudo ./flash.sh -r jetson-agx-orin-devkit mmcblk0p1”. I had issue when the Orin B boots up. It fails to mount the partition and keep restarting the boot cycle. Would you advise what commands to run for backup/restore if I have custom APP Partition size. Thanks

So how do you reuse it?

After I generated the back up image from Orin A, orin_backup.img, then I copied the image into ./bootloader/system.img", then run command to flash the image to Orin B ““sudo ./flash.sh -r jetson-agx-orin-devkit mmcblk0p1”. The flash completed but Orin B failed to boot as it has error when mounting the Partition. I wonder if these commands will work for customize APP Partition Size. In my Linux_for_Tegra folder I have ROOTFSSIZE=35GiB; within p3701.conf.common and <allocation_attribute> 0x8 </allocation_attribute> in flash_t234_qspi_sdmmc.xml.

can you help me run

file bootloader/system.img

I ran a different test with a back up image, the command “file bootloader/system.img” returns:
Android spare image, version:1.0, Total of 15158963 4096-byte output blocks in 23002 input chucks.

Upon boot it has this error:
mount: /mnt/: can’t find PARTUID=11daef0b-249d-4adf-8221-f6567c26e5c1

Is the PARTUID belong to the backup image (Orin A) and it is not the same as the current Orin B?

The PARTUUID is in the partition table. And thus it will not be carried over when you reuse the system.img. If you want to reuse you will need to flash with

Flash.sh jetson-agx-orin-devkit mmcblk0p1

Instead of

Flash.sh jetson-agx-orin-devkit internal

And make a copy from that

I used “mmcblk0p1” for both backup and restore commands:
Backup: “./flash.sh -r -k APP -G orin_backup.img jetson-agx-orin devkit mmcblk0p1”

After the backup is completed, I copy the orin_backup.img to ./bootloader/system.img
For Retore: “./flash -r jetson-agx-orin devkit mmcblk0p1”
After the retore the Orin failed to boot. One instant returns mount error on PARTUID, other instant it give me the black screen.

I search and found some issues at:

As with JetPack 6, Jetson_Linux R36.3, I cannot restore the Orin devkit from an image, regardless if I am customizing the ROOTFS partition size or not. For our program, we are using air-gaped system and restore from image is the only option.