If OH3 boot takes forever on Pi4 with SSB USB3

Posting to help people who might experience the same problem.

I was having problems on my OH3 on Raspberry Pi4 booting from SSD (ADATA SD600Q). For some reason boot would sometimes take forever or not complete.

My SSD had been installed through menu option 37, so, official OpenHabian 3 install and add-ons.

After much frustration I powered down everything, mounted the SD Card and the SSD on my main computer (which runs linux) and did some searching on the log files, especially /var/log/syslog for anything strange.

This log entry led me to the solution, so if you find something similar you have the same issue (search for uas_eh_abort_handler):

Mar 27 17:27:01 openHABianDevice kernel: [  524.016364] sd 0:0:0:0: [sda] tag#23  uas_eh_abort_handler 0 uas-tag 8 inflight cmd

The issue is that my SSD doesn’t implement well the UAS protocol, which is activated by default in USB3 devices, and causes problems in Raspberry Pi linux when not fully implemented. Solution is to apply a configuration parameter to a boot file found on the SD card

The detailed explanation where I found the solution is found here: https://www.raspberrypi.org/forums/viewtopic.php?t=245931

In a nutshell this is how I resolved it:

  • ran dmesg on my main computer after plugging the SSD into it
  • found the line which showed my device’s vendor and product id, like below (in my case 125f and a88a):
[91067.049642] usb 2-2: New USB device found, idVendor=125f, idProduct=a88a, bcdDevice=93.04
[91067.049648] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[91067.049651] usb 2-2: Product: SD600Q
[91067.049654] usb 2-2: Manufacturer: ADATA

The I went to the SD card, also plugged into my linux computer, at the boot partition found the cmdline.txt file and added this at the start of it (this was added before the rest that’s at the first line, not as a new or extra line):

usb-storage.quirks=125f:a88a:u

Unmounted SD and SSD from linux computer, plugged it all back into the Pi4, power on, and I could ping the Pi4 quickly.

Hope this helps someone out there.

2 Likes

Note that booting openHABian from USB (or Raspberry Pi OS which it is based on) is an untested, unsupported and therefore not recommended setup. I think the docs are quite clear on that.
If you want others to help you one day with your setup you better stay with the mainstream.
Your issues are an impressive example why, aren’t they ?

Thanks Markus for the comment.

Well, the history of linux and OSS has always been one of pushing the boundaries and facing the consequences. Sometimes with positive results.

In my case, although I respect the work you’ve all done in zram, I feel safer with an SSD where I don’t have to worry about maximum data I can store and so on.

I’ve run linux on SDD (main leisure computer) for years now. I know it works, and I know there is almost always a way around what doesn’t work, with some research.

And I truly believe you will gradually see more and more people taking this Pi4 + USB SSD route, as external USB SSDs go down in price. Hence my post, so the community has a resource to escape the issue I faced.

Happy hacking.

Yep, that’s what I’m afraid of: OH beginners to ignore the recommendations then come back here begging for help from right those people (me) that had told them not to take that route.

It isn’t about pushing boundaries or cost. The real challenge is about defining and automating a good (enough), reliable default that requires a minimum of work and knowledge in order to establish a mainstream that allows a maximum of users to stay away from all hardware and OS hassles.
OH is hard enough on its own.

I understand your fear. It is not fun when that happens, especially with beginners that aren’t reasonably technically skilled. It is a waste of precious developer time.

So I would respectfully recommend, if USB SSD is such a dangerous route, that option 37 be removed from the add-ons menu and from the documentation.

Because it is there is why people like me believe it works, is mainstream, and take the route of buying the hardware then trying to use it.

See, the documentation at https://www.openhab.org/docs/installation/openhabian.html#availability-and-backup gives you the impression that SSD is fully supported and I might say even encouraged, with these words (bold added by me):

Move the root filesystem to USB-attached memory. WARNING: USB sticks are as susceptible to flash wear-out as SD cards are, making zram the better choice for a standard Pi to run off its internal SD card. But you can use this option to migrate your system to a safe medium such as an SSD or HDD. See [menu option 37].

Zram being safer, because it isn’t susceptible to wear-out is not the same as saying it is the only recommended or supported method of running OH3.

Thanks for pointing out. Strictly speaking the docs are correct albeit not comprehensive. As you know, the crux is with booting.
I don’t want to remove the feature altogether as it is useful to people that know what they are doing but I’ve reworded the docs to hopefully keep beginners off that path.