[Solved] SSD Boot from Quad sata Hat

Hi,
You must boot from external HDD on USB2 port because SATA HAT disks are mount AFTER BOOT not during boot.
Regards

1 Like

Does gpio25 26 only include all drives 1-4, or one of the 4 drives?

Thanks @Craigp!

Worked exactly as described above.

@JKaw I would make sure after editing both files you reboot the Pi as instructed (with the existing boot SD or USB connected) so that the changes take effect. Shutdown the PI 4. Disconnect old boot device and power back on.

Hey @Craigp, thanks for the awesome finds and solution to this issue!

I followed your instructions and I finally made it to work. In my case, I can boot from an SSD attached to the HAT, but only once. Whenever I reboot or use the shutdown commands, the HAT fails to detect the drives attached to it (Greeted by the QR code and message that I need an OS). The only option I’m left with is to cut the power to the HAT from the barrel plug and re-seat it so it boots this way.

I don’t know why this is happening but any advice would be greatly appreciated!

I had similar behavior when the USB cable or when the GPIO connection was loose. Check both connections. Normally it should survive a reboot. I mean, if you shut down your Pi, you need to cut the power anyway. In order to boot afterward.

1 Like

Hey @estebanium thanks for the advice. Will definitely give it a try. I’m using the provided bridge connector from the HAT for the USB ports. I will reseat both.

It could be the same issue as you did experience, but does it make sense that the the boot works every time on cold start, but then it doesn’t with warm boot? I can reproduce this behavior 100% of the time. There isn’t any “flakiness” in regards to boot behavior. Maybe I should also mention that the boot drive isn’t an SSD, it’s an NVME in SSD enclosure, which may add more layers of firmware boot bugs…but then again it works once and then it doesn’t.

I feel like I’m missing something as a config option, but I have followed the guide exactly as described and it wouldn’t have worked at all if I didn’t do it properly.

It could be possible, that the NVME and all those layers are responsible for this issue.
On the other hand, it could be an issue with your fstab, crypttab or your cmdline.txt. I run a headless Ubuntu Server on that HAT. A SSD, with the OS and three hard disks are connected. I only address all of my drives via UUID, instead of /dev/sdX. However, I did notice that if I connect the server to my USB-Switch, to get my keyboard working, the server will fail to boot, because it will not find the SSD. Long story short, there are a lot of possibilities, why it won’t work.

  • Check your USB-Connections
  • Update the Firmware of the Pi. As far as I know, that NVME support is “quite” new. See here: “https://github.com/raspberrypi/rpi-eeprom/issues/378
  • Check your fstab, crypttab, cmdline.txt
  • Try out a SATA-SSD. There is a good Samsung 870 EVO, for just 63 EUR

Hey @estebanium sorry for my late reply. Yesterday after work I re-seated/re-plugged everything from scratch. Unfortunately the issue stays, but after some tinkering I was able to obtain a useful error code.

Unexpected error @ 0x000aa746
FATAL error-code 45

I read the article on the raspberry pi forum about it, but they also don’t know what it is.
https://forums.raspberrypi.com/viewtopic.php?t=330278

I’m sharing some of the config files in the forum, maybe someone else has better eyes to see an obvious issue that I miss…it will be helpful for anyone with a similar issue in the future, I think…

I’m using the following boot loader: 0fc8fc8e from date: 2022/12/07

Here’s the /etc/fstab:

proc		      				/proc           	proc    defaults          			0       0

PARTUUID=8b369230-01 /boot vfat defaults 0 2
PARTUUID=8b369230-02 / ext4 defaults,noatime 0 1

UUID=db8f44da-11e1-4638-bc58-9c0244f84597 /media/dir1 ext4 defaults,noatime,nofail,rw,auto 0 0
UUID=520e1318-126f-4942-9a8b-d858edbc89a9 /media/dir2 ext4 defaults,noatime,nofail,rw,auto 0 0
UUID=b638d8ca-1785-430d-8fbf-7634d1a8362b /media/dir3 ext4 defaults,noatime,nofail,rw,auto 0 0

Output from cmdline.txt:
console=serial0,115200 console=tty1 root=PARTUUID=8b369230-02 rootfstype=ext4 fsck.repair=yes pci=pcie_bus_perf rootwait

EEPROM looks like this:

[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0

[config.txt]
gpio=25,25=op,dh
gpio=26,26=op,dh

Finally, /boot/config.txt has the following uncommented lines:
dtoverlay=disable-wifi
dtoverlay=disable-bt
dtparam=audio=on
camera_auto_detect=1
display_auto_detect=1
dtoverlay=vc4-kms-v3d
max_framebuffers=2
arm_64bit=1
disable_overscan=1
otg_mode=1
arm_boost=1
dtparam=i2c1=on
dtoverlay=w1-gpio
gpio=25,25=op,dh
gpio=26,26=op,dh
dtoverlay=i2c-rtc,pcf8563

I’m not encrypting the root partition so I don’t have crypttab. I found this, but it seems to fix an issue with boot rather than cause it:

I will be more than happy to get any advice for something that anyone thinks it shouldn’t belong in the config files, but I simply can’t see anything that’s not ordinary or normal. Again, any advice is appreciated and thanks for your time until now!

An update to the issue. Got a brand new Samsung EVO 860 drive, dd’ed the old NVME to to it, same result - cold boot = no problems, restarting = cannot find boot partition and constantly changing between USB MSD and card reader with no result.
Considering using SD card with just /boot options and no rootfs - not sure if it will work as I intend to but it’s work in progress…
Thanks all for the suggestions!