I flashed the Orin NX device with a rootfs A/B partition, setting each partition size to 30GB. After booting, it shows that the current rootfs slot is A, and the / is mounted on /dev/nvme0n1p1. Then, I used the command nvbootctrl -t rootfs set-active-boot-slot B to switch to slot B. After rebooting, it indeed shows that it has switched to slot B, but the root directory is still mounted on /dev/nvme0n1p1.
Flash command:
sudo ROOTFS_AB=1 ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1 -c tools/kernel_flash/flash_l4t_nvme_rootfs_ab.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 jetson-orin-nano-devkit internal
flash_l4t_nvme_rootfs_ab.xml:
<?xml version="1.0"?>
<!-- Nvidia Tegra Partition Layout Version 1.0.0 -->
<partition_layout version="01.00.0000">
<device type="external" instance="0" sector_size="512" num_sectors="122159104">
<partition name="master_boot_record" type="protective_master_boot_record">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 512 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** Contains protective MBR. </description>
</partition>
<partition name="primary_gpt" type="primary_gpt">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 19968 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** Contains primary GPT of the `nvme` device. All
partitions defined after this entry are configured in the kernel, and are
accessible by standard partition tools such as gdisk and parted. </description>
</partition>
<partition name="APP" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> APPSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<align_boundary> 4096 </align_boundary>
<percent_reserved> 0 </percent_reserved>
<filename> APPFILE </filename>
<unique_guid> APPUUID </unique_guid>
<description> **Required.** Contains the rootfs. This partition must be defined
after `primary_GPT` so that it can be accessed as the fixed known special device
`/dev/nvme0n1p1`. </description>
</partition>
<partition name="APP_b" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> APPSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<align_boundary> 4096 </align_boundary>
<percent_reserved> 0 </percent_reserved>
<filename> APPFILE_b </filename>
<unique_guid> APPUUID_b </unique_guid>
<description> **Required.** Contains the rootfs. This partition must be defined
after `primary_GPT` so that it can be accessed as the fixed known special device
`/dev/nvme0n1p2`. </description>
</partition>
<partition name="kernel" type="kernel">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 67108864 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> LNXFILE </filename>
<description> **Required.** Chain A; contains boot.img (kernel, initrd, etc)
which is loaded in when cpu-bootloader failes to launch the kernel
from the rootfs at `/boot`. </description>
</partition>
<partition name="kernel-dtb" type="kernel_dtb">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 458752 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> DTB_FILE </filename>
<description> **Required.** Chain A; contains kernel device tree blob. </description>
</partition>
<partition name="reserved_for_chain_A_user" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 33554432 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** Reserved space for chain A on user device. </description>
</partition>
<partition name="kernel_b" type="kernel">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 67108864 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> LNXFILE_b </filename>
<description> **Required.** Chain B; contains boot.img (kernel, initrd, etc)
which is loaded in when cpu-bootloader failes to launch the kernel
from the rootfs at `/boot`. </description>
</partition>
<partition name="kernel-dtb_b" type="kernel_dtb">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 458752 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> DTB_FILE </filename>
<description> **Required.** Chain B; contains kernel device tree blob. </description>
</partition>
<partition name="reserved_for_chain_B_user" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 33554432 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** Reserved space for chain B on user device. </description>
</partition>
<partition name="RECNAME" type="kernel">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> RECSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> RECFILE </filename>
<description> **Required.** Contains recovery image. </description>
</partition>
<partition name="RECDTB-NAME" type="kernel_dtb">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 524288 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> RECDTB-FILE </filename>
<description> **Required.** Contains recovery DTB image. </description>
</partition>
<partition name="RECROOTFS" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> RECROOTFSSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Optional.** Reserved for future use by the recovery filesystem;
removable. </description>
</partition>
<partition name="esp" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 67108864 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> ESP_FILE </filename>
<partition_type_guid> C12A7328-F81F-11D2-BA4B-00A0C93EC93B </partition_type_guid>
<description> **Required.** EFI system partition with L4T Launcher. </description>
</partition>
<partition name="RECNAME_alt" type="kernel">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> RECSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** For fail-safe recovery update. </description>
</partition>
<partition name="RECDTB-NAME_alt" type="kernel_dtb">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 524288 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** For fail-safe recovery DTB update. </description>
</partition>
<partition name="esp_alt" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 67108864 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** EFI system partition for fail-safe ESP update. </description>
</partition>
<partition name="UDA" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 18432 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x808 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<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>
</partition>
<partition name="secondary_gpt" type="secondary_gpt">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 0xFFFFFFFFFFFFFFFF </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** Contains secondary GPT of the `nvme`
device. </description>
</partition>
</device>
</partition_layout>

