Jetson nano r32.2.1 PARTUUID not working while booting from USB

I am following GitHub - JetsonHacksNano/rootOnUSB: Set rootfs to be on a USB drive for booting Jetson Nano
I have multiple USB HDD connected to Jetson.
In previous release I was to set PARTUUID of the partition with the rootfs.
With with latest version some how is not working its always using sd card as rootfs.
If I set root=/dev/sda1 sometimes it tries to boot from wrong partition and fails.

following is my /boot/extlinux/extlinux.conf file:

TIMEOUT 30
DEFAULT primary

MENU TITLE p3450-porg eMMC boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} rootfstype=ext4 <b>root=PARTUUID=5d5d7022-01 </b>rw rootwait

LABEL emmc
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} rootfstype=ext4 root=/dev/mmcblk0p1 rw rootwait
cbootargs = tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,2 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1075 core_edp_ma=4000 tegra_fbmem=0x800000@0x92cb7000 is_hdmi_initialised=1  root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0    root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 root=PARTUUID=5d5d7022-01 rw rootwait

Can someone please help ?

You could try
root=UUID=
instead of
root=PARTUUID=

I don’t know why PARTUUID wouldn’t work but I use UUID so I know that works.

You could also try rebuilding the initrd with dracut. IIRC the initrd needs the capability to find the root filesystem by PARTUUID so maybe that’s missing in the pre-built one.

still the same.

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} rootfstype=ext4 root=UUID=51ee124b-7f10-4633-915a-a81fc5bc22c1 rw rootwait

it booted again from sd card

Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1   15G  9.2G  4.6G  67% /

Did you try with latest version ? It was working with previous release.

Yes, I’m using 32.2.1.

Are you sure that when you update extlinux.conf it’s the one in /boot on the APP partition of the sdcard? Could yo be accidentally updating a copy on one of the USB hard drives? I’ve done that a few times. :)
What does /proc/cmdline show?
Is /etc/fstab updated to use the new UUID for ‘/’?

Just to be double sure I am updating extlinux.conf on both the partitions(SD card and USB ) :)

/proc/cmdline:

tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,2 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1075 core_edp_ma=4000  root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0    root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 root=UUID=51ee124b-7f10-4633-915a-a81fc5bc22c1 rw rootwait

fstab has following do I need to update it ?

/dev/root            /                     ext4           defaults                                     0 1

Edit:
tried updating fstab with UUID but still no luck:

UUID=51ee124b-7f10-4633-915a-a81fc5bc22c1             /                     ext4           defaults                                     0 1

The only other thing that comes to mind is a duplicate UUID. Could the UUID on the USB root partition be the same as the one on the sdcard?

What’s the output of “blkid”?

lrwxrwxrwx 1 root root 15 Sep  8 14:29 dc21871e-9db4-434c-98b4-713f55f807eb -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 11 Sep  8 14:29 C62D-31F1 -> ../../loop0
lrwxrwxrwx 1 root root 10 Sep  8 14:29 c94e9f8d-1d74-478c-b956-85d81336a861 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep  8 14:29 51ee124b-7f10-4633-915a-a81fc5bc22c1 -> ../../sda1

They are different :(.

I wish NVIDIA had a better way to update to new release :(.
Flashing new disk for every release is too much pain.

Well I too had same problem
What I did to solve the same is,
only the partition being used as root was formatted as ext4 and all the others were formatted as exfat.
I used the following commands so that ubuntu would recognize/read exfat

$ sudo add-apt-repository universe
$ sudo apt update
$ sudo apt install exfat-fuse exfat-utils

I dont face such problem now and I can use my other hard disks on both windows pc and jetson nano easily

PS. Im new to ubuntu, so if something I said doesnt make sense, help me correct it.

OK, I just tried the same thing with a clean/imaged sdcard and and a USB drive yes, it’s broken.

Here’s why…
Although the usb driver is built into the kernel, the firmware is not. Unfortunately, it’s also not in the initrd image so by the time the root filesystem gets mounted, the usb controller isn’t initialized so /dev/sda isn’t available. In this case, the earlier “root=” command line parameter takes effect and is used. Once that filesystem is mounted, /lib/firmware/tegra21x_xusb_firmware becomes available and the usb controller initializes and adds /dev/sda. By that time it’s too late of course.

Here’s how you fix it WITHOUT HAVING TO COMPILE YOUR OWN KERNEL (or anything else).

Boot to the sdcard then…

# cd /etc/initramfs-tools/hooks

Create a new file “usb-firmware” with the following contents:

if [ "$1" = "prereqs" ]; then exit 0; fi

. /usr/share/initramfs-tools/hook-functions

copy_file firmware /lib/firmware/tegra21x_xusb_firmware

Make the file executable

# chmod a+x usb-firmware

That causes the mkinitramfs process to include the firmware in the image.

Regenerate the initrd:

# mkinitramfs -o /boot/initrd-xusb.img

There’ll be some warnings but don’t worry about them.
Make sure it worked.

# lsinitramfs /boot/initrd-xusb.img | grep xusb
lib/firmware/tegra21x_xusb_firmware

Now edit your /boot/extlinux/extlinux.conf file and update the INITRD line to point to /boot/initrd-xusb.img

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd-xusb.img
      APPEND ${cbootargs} root=UUID=<your sda1 uuid> rootwait rootfstype=ext4

Reboot and enjoy.

Don’t forget to copy the usb-firmware script to /etc/initramfs-tools on /dev/sda1.

EDIT:
Oh yeah… The reason I didn’t notice this earlier is that I use a Fedora root filesystem :)

2 Likes

Thanks alot gtj. It worked perfectly.

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        44G  8.9G   32G  22% /

For some reason l

sinitramfs /boot/initrd-xusb.img | grep xusb

was empty but everything worked fine :). Thanks again for your help.

Sorry but this didn’t work.

THANK YOU gtj! This worked on a TX1 as well! I had been troubled for days over this. Will report back if it works on a TK1 (and thank you again!).