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.

3 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.

After having severe problems from booting my Raspberry Pi 4 with and USB SSD I was finally able to get it working properly. You need to set the Raspberry to use USB for boot.

First, it is important that your Raspberry Pi4 firmware have been updated to a version from or newer than 2022-08-04.

You can update with the following commands.

sudo apt update
sudo apt upgrade -y
sudo rpi-update

After the update, you need to reboot your Raspberry 4

Then download RPI imager from Raspberry Pi website
[Raspberry Pi OS – Raspberry Pi]

  • Get an empty SD card
  • Start the RPI imager
  • Select OS in RPI imager
  • Choose ‘Misc Utility Images’
  • Next choose bootloader
  • Select USB Boot
  • Select ‘choose storage’ in RPI imager
  • Write the card
  • After card has been verified, remove the card and insert in the Raspberry
  • Remove any USB SSD that is already connected
  • Power up the raspberry wait about 35 seconds and the green power led should flash consistently. (If you have a monitor, the sreen will be green)
  • Power off the Raspberry and remove the SD card.

Now, with your USB SSD, Openhabian should work flawlessly and fast.

2 Likes

Just to remind you and all others to read this,
openHABian on RPi does not support booting from SSD (or other medium beyond the default SD).

1 Like

There is an obvious reason I am not using the community for all my questions. It used to be my main source for information, but now I mostly use other sources.

Markus
I have a lot of appreciation for all the work you do. However, if I have a solution that works, other community members are not advised by you to follow the instructions I have given. Maybe let the other members decide themselves.

This is my last post in this community. Too bad, so sad.

2 Likes

That’s not right. I did not advise anyone or even decided anything for them.
With your post you have revived a 2yr old thread you haven’t even been a contributor to so far.
All I did was to recall the official statement (it’s also part of the docs) that it isn’t supported by openHABian maintainers so people to read this thread are aware of this being a relevant fact.
As openHABian maintainer and guy most people will ask for help and expect a solution from should there be issues I think it’s also a question of fairness concerning myself.

And it’s of concern to any user who thinks about taking that route to name the implications so he or she can make an educated decision on the matter.
Any user clearly is free and the only person to decide for him or herself what to make of this information, of course.
To jump in and apply, to ignore it, to be in a huff and leave the community, or to instead contribute to openHABian to have others benefit from your solution, too. Choice is yours and anyone else’s.