Booting Openwrt on x86 via USB Hard Drive

I am trying to boot OpenWRT x86/64 from a USB Hard Drive but can't get it to work, it hangs at "Waiting for root device PARTUUID=95a30341-02..." I have tried both "generic-ext4-combined.img.gz" and "generic-squashfs-combined.img.gz" from https://downloads.openwrt.org/releases/23.05.4/targets/x86/64/

To be clear, these images work perfectly fine if I write them to a USB Flash Drive, the problem only seems to exists when I write them to a USB Hard Drive or USB SSD of which I have tried several and on two different computers.

What am I doing wrong?

The procedure is pretty much the same, but please clarify what exactly you tried to install OpenWrt on the disk. Full download URL, full command history.

2 Likes

I used Rufus (on Windows 10) to write the img.gz file to the USB HDD/SSD, which is also the same software I used to write to the USB Flash Drive (Which does work). Your question does prompt me to think that perhaps I should try DD in Linux to write the image instead, will do that now and have a look.

wget -qO- https://downloads.openwrt.org/releases/23.05.4/targets/x86/64/openwrt-23.05.4-x86-64-generic-squashfs-combined-efi.img.gz | gzip -dc >/dev/sdX
1 Like

RARE:
it's possible the enclosure you're using with the hard disk/sdd isn't compatible enough to boot the operating system ?

The booting may have progressed enough you might be able to edit the boot loader config to put in the necessary usb quirk

example of a linux kernel command line quirk:

usb_storage.quirks=2109:0715:ut

the two numbers are the device id, and the letters at the end are the quirks, the u disables UAS which can impact performance but can make inaccessible devices accesible

to find out the address you should use, have the device plugged and run lsusb

eg.

Bus 002 Device 005: ID 2109:0715 VIA Labs, Inc. VL817 SATA Adaptor

another example when running lsusb:

Bus 002 Device 006: ID 152d:0578 JMicron Technology Corp. / JMicron USA Technology Corp. JMS578 SATA 6Gb/s

so then the quirk would be:

usb_storage.quirks=152d:0578:ut

1 Like

Then why don't you just use the USB flash? OpenWrt doesn't really need much space, frankly speaking I have one x86 machine with internal USB socket, I simply reuse my super old 256/512MB (yes, MB, not GB) flash drive to build the firewall.

Thank you for that one liner, its alot nicer than the way I was doing it.

So some progress, using the one liner I wrote the img to both the USB drive and the USB Flash, same issue as before, flash drive works no issues, USB HDD gets stuck at "waiting for root device"

I did then remove the HDD from the USB enclosure and install in directly into the computer via SATA and then it boots with no issues, I want to blame the Orico USB Enclosure, but I have tried 2 others and different drives as well one was an SSD but they all get stuck.

The post from @wilsonyan looks promising, will look now into how I can test that out.

@fakemanhk I normally would just continue to use the flash drive or install openwrt on an internal drive, but pushing forward to use this as a learning project.

Orico is one of the worst USB HDD enclosure, their firmware is bad and most people encounter weird problem and data lost with their enclosures (esp. the multi-bay one), I would not use it again because I also had bad experience with them.

it's kinda ironic, i've been fighting with a multi-tf/microsd raid card and it will only work reliably with a via chipset enclosure and only when using those quirks and orico just happened to be the brand that used via for a while heh
I tried jmicron and asmedia, they both either don't get recognised at all or crap out pretty quickly

I know what you mean about the multi-bays, I like to use this method over using NAS but I have to admit it can get pretty frustrating at times to get things working reliably

1 Like

After writing the image to the drive what is the partition UUID?

With the drive connected run blkid to make sure the id matches, if not change the fstab and grub config

1 Like

Thank you for your post man, adding the line to my grub config did the trick, it now boots, my usb controller is of the jmicron variety for posterity.

Thank you for your post mate, I have just finished testing the suggestion made by @wilsonyan and it now boots successfully, the problem was indeed an issue with the usb sata controller quirk.