How to boot ubuntu 18.04 from one USB 2.0 disk

Hello to everyone.

ubuntu (18.04) is not able anymore to boot from the sd card because the sd card slot does not fit perfectly under the housing. I’m trying to boot 18.04 from the USB port. What I did right now has been to clone ubuntu 18.04 from the sd card to one of my USB disks and I tried to boot it,attaching the disk to the USB 3 port. Something may be missing or wrong in this workflow because ubuntu does boot at all. Where could be the mistake ? I’m reading the instructions from here :

it seems that “with the introduction of JetPack 4.5, it is now possible to boot your Jetson Nano from a USB drive”.

ok,I’ve installed the JetPack 4.6.3 and the Jetson Linux 32.7.3 on ubuntu 18.04. Is there some specific procedure that I should perform to enable the booting of Ubuntu from the USB disk ? thanks.

NB :

I have also added this line to the file /boot/extlinux.conf (and I’ve commented the previous similar line),where PARTUUID is the value that I’ve from from the root partition that I see when I run gparted.

APPEND ${cbootargs} quiet root=PARTUUID=66181078-3393-4d65-bae1-8e21a434c5b5 rw
rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0
net.ifnames=0

This is the USB disk structure (cloned from the sd card) :

Disk /dev/sdl: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: 2500BMV External
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: 91FC289A-1E03-495A-9DAD-732401089949

Dispositivo Start      Fine   Settori   Size Tipo
/dev/sdl1   28672 384501759 384473088 183.3G Linux filesystem
/dev/sdl2    2048      2303       256   128K Linux filesystem
/dev/sdl3    4096      4991       896   448K Linux filesystem
/dev/sdl4    6144      7295      1152   576K Linux filesystem
/dev/sdl5    8192      8319       128    64K Linux filesystem
/dev/sdl6   10240     10623       384   192K Linux filesystem
/dev/sdl7   12288     13055       768   384K Linux filesystem
/dev/sdl8   14336     14463       128    64K Linux filesystem
/dev/sdl9   16384     17279       896   448K Linux filesystem
/dev/sdl10  18432     19327       896   448K Linux filesystem
/dev/sdl11  20480     22015      1536   768K Linux filesystem
/dev/sdl12  22528     22655       128    64K Linux filesystem
/dev/sdl13  24576     24959       384   192K Linux filesystem
/dev/sdl14  26624     26879       256   128K Linux filesystem

Someone else will have to answer, I’ve not booted a Nano from a USB 3 disk. However, I want to mention a limitation should you get it to work: I think the USB driver in boot stages only supports USB2. Someone else might know for certain if that old limitation is still around. That means it would remain in USB2 mode after boot unless you’ve made some sort of custom initrd to work with that.

its very strange because the author of the tutorial used an USB 3.0 + disk.

He says :

Here are a few drives we’ve had success with (affiliate links):

Samsung T7 500 GB USB SSD: https://amzn.to/3vdp62b

Samsung T5 500 GB USB SSD: https://amzn.to/2PtE7bK​

Western Digital 2TB External Hard Drive: https://amzn.to/3t7A7jH

Maybe the driver was updated since I last looked at it. However, a USB3 disk would work even if the driver in boot stages had not been updated; it is just that the disk would remain in USB2 mode once boot completes.

Incidentally, one can see the USB speed with the tree view:
lsusb -t

If the item line ends with “480M”, then that is USB2; if it ends as “5000M”, then it is USB3 (USB3.1 gen. 1). Nano does not have USB3.1 gen. 2, but if it did, then the line would end “10000M”. Those are speeds in Mbit/s.

The issue is that if and only if the boot stage driver starts in USB2 mode, then USB has to go through a reset to change to USB3 mode, but that also means loss of the filesystem during that transition. It would be nice if boot stages have a USB3 mode, but in the past this was never updated. Maybe it has changed? Don’t think so, but it might have.

The reason why I want to boot Ubuntu from my USB 3 disk is that I should insert and remove the sd card inside the slot a lot of time before Ubuntu is able to boot. So,I presume there is an hardware defect.

Anyway I’m not able to boot ubuntu from the USB disk using the jetsonhacks method. The jetson nano freezes on the NVIDIA logo screen. Do you know another method ? I have a couple of USB disks and a spare 2.5 sata hard disk. So maybe I can use the Geekworm T300 V1.1 2.5 inch SATA SSD/HDD Shield Storage Expansion Board ? Is this board supposed to overcome the problem that I have ?

I’ve attached the serial console to understand what’s the error that happens when I try to boot the USB disk and this is :

https://pastebin.ubuntu.com/p/ddfCzRj8Hp/

Scanning usb for storage devices… 0 Storage Device(s) found

the USB 3.0 disk (with ubuntu 18.04 installed inside) that I have attached is not detected at all.

I don’t have any alternate boot devices, so I cannot help much with that. What I do see is that it is going through the list of devices which were found and meet boot criteria, and none were found; thus it goes on to bootp, a network boot:

[0003.930] Found secure-pmc; disable BPMP                                                 
                                                                                          
3 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device

Device 0: unknown device

Warning: eth_rtl8169 using MAC address from ROM
BOOTP broadcast 1

I am only guessing, but I’d say that either when flashed the target named (and which is part of QSPI memory), a kind of “pointer” to boot device, was not correct for finding the USB device (a USB driver could be present, but if the pointer does not look at the USB device for boot, perhaps it would be ignored), or else the target pointed at for boot did not contain what was needed to find the extlinux.conf (or other boot content for continuing boot). I don’t know.

Obviously USB drivers exist, but mass storage drivers have to run on top of that. If no mass storage driver existed, then it cannot detect USB boot devices even if USB itself works. If USB mass storage drivers are present, then it still needs to be able to understand the filesystem type, e.g., ext4, and so if that driver were not present in the bootloader code, then even a valid boot device would not be considered bootable.

My main point has been that in the past I know USB2 drivers were present for Nanos, but USB3 was not available until booting to Linux. The result would be that if the USB boot device worked correctly, then it would have to remain in USB2 mode once booted (unless some sort of initrd trickery is used).

What was your actual flash command? Did it point at “/dev/sda1”? Note that it might be a chain load on top of any other requirements, which means it is possible that the SD card would have to be present anyway (just long enough to read the extlinux.conf and perhaps kernel…but that is speculation and only counts if chain loading).

The real question is why it fails under SD card boot. You’d need the serial console boot log for that (I think the log you provided is for USB boot). Did you flash the Jetson itself with the same release as that which is used in the SD card and/or USB drive?

this is my extlinux.conf :

TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet root=PARTUUID=adb2cacc-27cb-423a-9035-a9e35e8202e4 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

# When testing a custom kernel, it is recommended that you create a backup of
# the original kernel and add a new entry to this file so that the device can
# fallback to the original kernel. To do this:
#
# 1, Make a backup of the original kernel
#      sudo cp /boot/Image /boot/Image.backup
#
# 2, Copy your custom kernel into /boot/Image
#
# 3, Uncomment below menu setting lines for the original kernel
#
# 4, Reboot

# LABEL backup
#    MENU LABEL backup kernel
#    LINUX /boot/Image.backup
#    INITRD /boot/initrd
#    APPEND ${cbootargs}

this is the structure of the disk :

About which kind of flash command are you talking about ? this is how the “BootFromUSB” script works :

sudo rsync -axHAWX --numeric-ids --info=progress2 --exclude=/proc / "$DESTINATION_TARGET"

it wants to copy the content of the partition where previously I’d installed ubuntu to the usb disk. Nothing more.

Is that the same extlinux.conf on both the SD card and the USB disk? If not, try having that on both. Also, at least temporarily, try changing the partition ID for “/dev/sda1” (or whatever that device is…it could be a “/dev/nvme0n1p1”, depending on media). The “/dev/sdn1” is probably from viewing from a host PC, and on the Jetson it is likely “/dev/sda1”. Having extlinux.conf on both SD card and USB disk means you’d have success regardless of which device’s extlinux.conf is used (although if the entry doesn’t work it still won’t work even if the entry is configured on both boot devices).

I strongly suggest that instead of replacing the existing extlinux.conf entry you instead add a second entry with the alterations, and then use serial console to select that alternate entry. I am a fan of leaving original content as a backup plan.

is this good ?

TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

LABEL backup
    MENU LABEL backup kernel
    LINUX /boot/Image
    INITRD /boot/initrd
    APPEND ${cbootargs} quiet root=/dev/sda1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

and I place the sd card inside the slot. that’s right ?

ok this is the log :

U-Boot 2020.04-g4335beb (Nov 22 2022 - 09:21:37 -0800)

SoC: tegra210
Model: NVIDIA Jetson Nano Developer Kit
Board: NVIDIA P3450-0000
DRAM:  4 GiB
MMC:   sdhci@700b0000: 1, sdhci@700b0600: 0
Loading Environment from SPI Flash... SF: Detected mx25u3235f with page size 256 Bytes, erase size 4 KiB, total 4 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
Card did not respond to voltage select!
Card did not respond to voltage select!
starting USB...
Bus usb@7d000000: tegrausb: Invalid dr_mode 2 for host mode
probe failed, error -1
Bus xusb@70090000: Loading XUSB FW blob from RP4 partition ...
SF: Detected mx25u3235f with page size 256 Bytes, erase size 4 KiB, total 4 MiB

Firmware size 126464
Firmware timestamp: 0x5f23e558, Version: 50.26 release

Register HCSParams1: 9000124 NbrPorts: 9
Starting the controller
USB XHCI 1.00
scanning bus xusb@70090000 for devices

nothing happens. It is frozen there.

You could also have an extlinux.conf entry naming the partition UID as well, but yes, the mentioned extlinux.conf edits should do the job.

Someone else would have to answer why searching for the USB device directly blocks. Normally a boot has a list of devices to try, and if one fails it goes on to the next possible device until it reaches the last device (bootp). Think of a partition UID as a marking which can be searched for on all devices, but specifically naming “/dev/sda1” implies an exact device. So the failure might be the same as before, but due to naming an exact device (instead of markers to scan for) it could result in not going on after this.

But I am curious about something. If you tell it to use sda1, and it halts like this, and you keep monitoring the serial console, what happens if you unplug and replug the USB storage?

scanning usb for storage devices... 0 Storage Device(s) found

Did you understand why the booting from the sd card fails ? I’m not able to boot Ubuntu neither from the sdcard nor from the usb.

Do I need to flash the board using the SDK manager to enable the booting from the USB port ?

I do not know which extlinux.conf is being used. The pointer to that extlinux.conf is more or less in QSPI memory, and this does indeed require flashing with SDKM. The boot will not simply use USB or SD card interchangeably unless that initial pointer to boot media finds its extlinux.conf. If the pointer points at the SD card, then having USB won’t matter unless SD first points to USB; conversely, if that first pointer names the USB device, then unless USB has its extlinux.conf found and chain loading to SD, an SD card boot will fail. It is often easier when testing to have both media types present, and multiple entries in extlinux.conf with different boot labels so you can determine in serial console which extlinux.conf is found.

Flashing to target mmcblk1p1 (SD card) means this is where the pointer starts looking, and even if sda1 (USB) is otherwise valid, sda1 would never boot (unless mmcblk1p1 is present and names sda1 in extlinux.conf…but then it is chain loading). So yes, flashing is needed to change the QSPI memory.

Hello.

I’ve just had some progress. I’ve used an sd-card to usb adapter. I’ve placed inside the slot of that adapter the sd card where previously I’d installed ubuntu 18.04 and I tried to boot it. Inside the extlinux.conf I have used :

      APPEND ${cbootargs} quiet root=PARTUUID=adb2cacc-27cb-423a-9035-a9e35e8202e4 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

and yes,it booted. Unfortunately ubuntu stopped early the booting process telling :

what’s the problem now ? And yes,I used this adapter :

KiwiBird USB C USB-A SD card reader, Micro USB Type C Adapter for card SDXC SDHC TF UHS-I

It is an SD card reader multifunction,USB 2.0 (type A). The USB disks that I tried before are “Western Digital My Passport Essential USB 2.0”.

At this point I really don’t understand why with the adapter I can boot Ubuntu (at least partially) attaching it to the USB 3.0 port of the jetson nano,but if I attach one of my Western Digital’s disks,they aren’t recognized at all.

I suggest removing the “quiet” from any extlinux.conf (at least while developing or debugging). This causes a lot of console logging to not show up when “quiet” is present.

Is this a development kit? Or is it a third party carrier board? If it isn’t a dev kit, then it probably has an incorrect device tree (assuming it was flashed with NVIDIA’s software for dev kits).

Incidentally, you’ve probably seen UNIX/Linux books which often say “everything is a file”. File I/O covers a lot of what is needed. Even I/O devices like a serial UART or a disk partition will show up as a file, and permissions and read/write operations tend to be somewhat “generic”. However, files which are not part of the filesystem, in which the file is really in RAM and is part of a driver pretending to be a file, makes it possible to customize some non-standard commands. Numeric commands are “ioctl” calls (I/O Control), defined by the driver itself as to what it’ll listen to (and uses a special call which is not a standard file read/write). As an example, one camera might have different customized controls for changing whether it is in color or grayscale mode; a camera without color would not implement a color ioctl call, it would be pointless. When you see “Inappropriate ioctl for device” it implies that the user space software talking to the device is incorrectly assuming which device it really is (e.g., you might use camera software with color abilities to talk to a camera with only grayscale, which means it would be an error for the user space to try to go to color mode). I don’t know which device the “inappropriate ioctl” was, but the driver for that device does not support the operation required.

That inappropriate ioctl might be from “sda” as it does directly follow talking to the device. Perhaps some such block devices have options for caching that this one does not have, and thus the lack of the ioctl would not really mean anything. However, let’s say the USB has loaded, and announced the device to the hot plug layer as a block device…then some block device driver would try to take over, but if that driver was not correct for that hardware, then the inappropriate ioctl would mean you simply don’t have the correct driver. I don’t know from what that screenshot shows what is really going on, I only know that a driver was asked to do something it couldn’t do.

The earlier i2c probes I think are harmless and unrelated. The tegradc might or might not be an issue; certainly it matters if the system had booted, but not been able to display the GUI; without reaching the GUI I wouldn’t consider the tegradc message as having any meaning.

So I suggest removing “quiet”, and then booting with a full serial console log instead of using screenshots. It would provide much more detail.

My jetson nano is the “seeed studio NVIDIA Jetson Nano Developer Kit Small Computer for AI Development - B01 New Version” ;

I used the UUID number,not sda on the extlinux.conf :

root=PARTUUID=adb2cacc-27cb-423a-9035-a9e35e8202e4

I see that on the tutorial that I have followed to boot Ubuntu from the USB disk :

he suggested to create one only ext4 partition (with the disk partitioned as GPT style). I wonder why. Actually I tried to boot the adapter with the sd card where I have installed ubuntu traditionally. Infact the partition scheme of the sd card is the following :

Disk /dev/sdl: 183.35 GiB, 196865949696 bytes, 384503808 sectors
Disk model: Storage Device  
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: 91FC289A-1E03-495A-9DAD-732401089949

Dispositivo Start      Fine   Settori   Size Tipo
/dev/sdl1   28672 384501759 384473088 183.3G Linux filesystem
/dev/sdl2    2048      2303       256   128K Linux filesystem
/dev/sdl3    4096      4991       896   448K Linux filesystem
/dev/sdl4    6144      7295      1152   576K Linux filesystem
/dev/sdl5    8192      8319       128    64K Linux filesystem
/dev/sdl6   10240     10623       384   192K Linux filesystem
/dev/sdl7   12288     13055       768   384K Linux filesystem
/dev/sdl8   14336     14463       128    64K Linux filesystem
/dev/sdl9   16384     17279       896   448K Linux filesystem
/dev/sdl10  18432     19327       896   448K Linux filesystem
/dev/sdl11  20480     22015      1536   768K Linux filesystem
/dev/sdl12  22528     22655       128    64K Linux filesystem
/dev/sdl13  24576     24959       384   192K Linux filesystem
/dev/sdl14  26624     26879       256   128K Linux filesystem

this could be the reason ? it may expects to find a single EXT4 partition,instead of that partition scheme ? And…do you have an explanation about why it boots from USB using that converter but it does not boot if I attach directy the WD disk on the jetson nano USB 3 port ?

I removed the quiet parameter and I’ve got the same exact error messages.

I’ve talked with Jim of the “Jetson Hacks” website. He suggested to use one powered USB hub and I tried. I have connected the USB 3 cable from the USB powered hub to the USB 3 port of the jetson nano. When I turn on the board,the USB powered hub does not turn on.