[Solved] SSD Boot from Quad sata Hat

Hello radxa community,

I’ve recently bought the Quad sata Pi hat, and I love it!
I’m only using 2 hard drives though, and I was thinking about installing and booting my pi off an ssd.

So I had 2 ideas:

  1. Try to use an ssd inside the Quad sata Pi hat, although I don’t know how this would affect speed.
    or
  2. Remove the dual usb connector, and since I’m only using 2 hard drives I can work with only 1 usb 3.0 between the pi and sata hat, and use the other 3.0 port for my ssd. But here I don’t know which USB corresponds to which sata port:
    Top usb for sata1 && sata2, Bottom for sata3 && sata4?
    or:
    Top usb for sata1 && sata3, Bottom for sata2 && sata4?

Another question, if option 1 were to work, would it be better for speed to keep the hard drives on a single usb connection (eg. top usb - sata1 && 2) and keep the ssd on sata 3 or 4, or would there be another way?

Which option would you think is better?

Thank you.

Edit, I haven’t found out with sata ports correspond to which usb, but I know that it’s not possible to boot from and ssd thats on the sata hat.

Oh that’s a pity - When I reached out to the guys via twitter, they raised no concerns regarding USB booting. So I’ll probably be unable to use the HAT

20

1 Like

The thing is the sata hat software gets initialized only after booting, therefore an ssd connected to the sata hat cannot be seen, because the system needs to boot first.

I tried ones to boot from SSD by using the gpio-poweroff overlay to set the sata hat reset pin (GPIO 25 or 26, depending in with slot the boot disk is) high/low during boot and modified the hat’s python script in a way that it doesn’t overwrite the pin state. I got to a point that it was showing the “Welcome to Rasbian” messages, but after that it was incredible slow and almost doing nothing. Maybe it had something to do with this: https://www.raspberrypi.org/forums/viewtopic.php?t=245931

I gave up on it at the moment, but think it could be possible this way. If you look into the sata hat script, it only sets these pins high to mount the disks + a diff before and after to recognize with disks are added by the hat. The diff is only used to display the disk info, but isn’t needed to use the disks.

IMHO this is an important pending question!
I believe that for experts (@jim) it should not be too difficult to tell how the
GPIO pins can be manipulated early in the beginning so that the disks on the sata
hat get powered early and therefore can hold the system to be booted.

I agree.

I’m booting of an ssd (usb2.0 port) and using the microSD card as a backup.

It sucks even more because I’m only using only 2 HDD’s on the quad sata hat, basically rendering one of my 3.0 ports useless.

Well not fully useless, because I’m guessing if both hdd’s ran from the same USB3.0, speeds would be halved (from 110Mb/s to 55ish last time I tried using a 3.0 male to male cable just to connect one of the ports from the sata hat to the pi), but I think I would be willing to make that sacrifice just to have a faster filesystem. The problem here was that my sata->usb3.0 adapter’s chipset apparently doesn’t work on the Pi so it only works on USB2.0 speeds even though it works at 3.0 on both my laptop and pc. I’ve just dropped the case after this…

I’ve also tried booting off of the usb-c port but on the RPi4b it only has the USB 2.0 spec.

My hope is that at least one of the following 3 things happen:

  1. I save enough money to buy an actual server. (less likely :c )

  2. A new RPi comes out with 4 USB3.0 ports.

  3. The SataHat team figures out a solution how to boot from the sata hat.

I’m rooting for #3 but don’t tell anyone, it’s a secret.

About 1st - it’s not that costly as you think (look for some motherboard with embedded processor). The problem is electric bill in this case.

Also about 3rd, what the problem? Have you tried

Well money is not the only problem. If I ever switch homes, I’ll have to make sure to have a dedicated server room like linus. I don’t want to hear my server’s noise all day.

Also, the USB boot is working. It’s just that it’s running on an USB2.0 port, reducing my speeds greatly. The Quad sata hat uses both my 3.0 ports, even though I’m only using 2 HDD’s.

You wrote “I’m rooting for #3 but don’t tell anyone, it’s a secret.” but unfortunately
I can not understand it. Could you please enlighten me?

Thanks for pointing to that article from Tom’s hardware which also links to a similar
text from the foundation

However, point 3 from @pimpek agreeing that booting directly from the sata hat is a legitimate
request at the manufacturers of these hats and this problem does not get solved by booting
from an usb disk not attached to the hat.

BTW: I do not understand why the power of the SATA-disks gets switched on/off on the hat,
because switching off the drive motors would be possible by hdparm commands…
This IMHO was additional cost without any real use!

What I meant is I’m hoping that #3 will happen.

That “the SataHat team figures out a solution how to boot from the sata hat.”

Theoretically you could hardwire the GPIO pins that pilot the disks to 3V3. In the code change the GPIO config to INPUT instead of OUTPUT.
Just an idea, haven’t tested this.

Unfortunately I am nowhere near in having the experience to do this.

@pimpek:
It is a shame that Seedstudio does not at all care for their paying customers.
Maybe some lucky day the truth about the non existing customer care of Seedstudio gets known and a competitor with decent supports takes over…

I had a 20 minutes of hope, I was thinking using a usb 3 hub could lead to a “not so bad” solution to get the ssd boot (by using usb A - A cables with a usb 3 hub on 1 rpi port, and booting a usb enclosed ssd on the second port). Unfortunately, it’s a no way, usb ports of the hat aren’t recognized by the system if not using the provided usb bridge.
Maybe using a overlay could be a satisfiying answer, but after few days of research, I still didn’t find the correct guide to do so (almost all answers are about using a ramdisk as overlay, which is not what we want of course).
I also looked in bcache, IOEnhancer or other similar software stuffs, but bcache isn’t supported in rpi kernel without recompiling it (and I don’t have all the time required to learn to do that), and IOEnhancer seems not supported anymore…
Would be nice if we could have at least an easy way to use a SSD as overlay of the sd card rootfs !

1 Like

Well I have had success with this. On an RPI 4 with an and I used Raspberry Pi OS 2021-01-11, as you need to a particular setting in the eeprom. All the information about what I did can be found here
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md a link that was already mentioned

You use
$ sudo -E rpi-eeprom-config --edit
to edit the eeprom and add this to the bottom

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

Then save and exit. This sets the gpio pin to be outputs and set to high in the eeprom then because of the 20 second time out for USB MSD devices there is enough time for the devices to power up and boot from. this is how my setup is now. ( I have the first get quad sata hat) but it really shouldn’t make a difference
Before rebooting you also have edit the /usr/bin/rockpi-sata/misc.py and remove turning disks off. If you have install the rockpi-sata service otherwise when you restart the rockpi-sata service it kills your system drive. I just commented out the set_mode low

def disk_turn_off():
#    set_mode(26, GPIO.LOW)
    time.sleep(0.5)
#    set_mode(25, GPIO.LOW)

Let me know if anyone needs more details.

5 Likes

@Craigp
Sadly this did not work for me, the pi still won’t boot from the SSD connected to the quad sata hat

I am not sure if any of these could be the problem.

  1. I updated my firmware to have different serial numbers How to upgrade F/W with jms561 under Windows
  2. I tested my drive with as an external usb device first to make sure it booted via the USB. There are plenty of resources that show this
  3. My full config looks like this
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0


[all]
BOOT_ORDER=0xf41


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

The BOOT_ORDER configuration details are here https://www.raspberrypi.org/documentation/computers/raspberry-pi.html#raspberry-pi-4-bootloader-configuration
0xf41 means Try SD first, followed by USB-MSD then repeat (default if BOOT_ORDER is empty). So remember to remove your SD Card

The lights should turn on almost instantaneous if this doesn’t happen check your firmware version only the later versions of the firmware allow the [config.txt] section

[SOLVED]

Don’t copy the content of boot and root partitions to the hdd or ssd. It only worked for me if I dd the partitions from the SD card to the hdd. Don’t forget to change the PARTUUID in the cmdline.txt and in the fstab! The PARTUUID is NOT the same one as on the sd card even wenn you dd the partition.

If your not familiar with dd, you can use the sd card cloning software in raspberry pi os. For this you must have an spare sd card to boot raspverry pi os in desktop mode, start the sd card copy programm an copy the sd card from your server to the ssd or hdd.

Now the system is booting from the hdd which is part of the SATA HAT.

That was a hard piece of work!


Hi! I try to boot from an 3.5’’ hdd and the boot process starts with loading the kernel but than it stops without an error message.

What works:
Booting the system from USB 2.0 with my SD Card in an ordinary cardreader.

What dosn’t work
Booting from an hdd connected by the sata hat (When booting from SD the hdd is accessible as usual)
loading the kernel woks but then the process stops.
From time to time I get a Kernel panic. Dont know what makes the difference.
LED on the boot drive is on. LEDs of RAID-system is off

What I did
Updated the firmware of the JM561 controller (under linux because under Windows the flashing software couldn’t find the card)
created an hardware RAID 1 with the raid manager software (first tests are promising speed ~ 90MB/sec)
changed the boot order of the raspberry pi 4
copied the root system to an hdd
changed the configuration of the sata-hat as mentioned in post 18
changed the configuration of the location of the root filesystem in cmdline.txt and fstab (rootfs on hdd)
changed the way of configuration of the lroot filesystem from PARTUUID to UUID in cmdline.txt and fstab
Changed the SATA port of the boot device -> same result
tried booting the kernel from SD and rootfs from hdd -> same result, boot process stops, no error message

Any suggestions are appreciated.!!

Thank you for your fine solution. I have been using RPI4 and Quad Sata Hat and very satisfied with it.
Recently, I recently changed the OS to Debian Bullseye from the RaspberryPi OS. Is there any way to enable GPIO25, 26 pins on the Debian OS? It seems there is no config.txt file on it.
(I’m new to Linux OS. I’m sorry if the level of the question was poor.)