SATA HAT disk order

I have the RPI4 QUAD SATA HAT, currently with 4 disks connected. Is there a fixed order in which the SATA ports 1-4 are mapped to /dev/sda-/dev/sdb?
I would have expected port 1 to sda, port 2 to sdb etc but that apparently isn’t the case. Maybe it depends on how fast the individual drives start up? Currently I have:
<edit, I had the ports wrong>

  • SATA port 1 -> /dev/sdc
  • SATA port 3 -> /dev/sda
  • SATA port 2 -> /dev/sdd
  • SATA port 4 -> /dev/sdb

With if i’m not mistaken SATA port 3 and 4 being on one WD USB to SATA converter and SATA port 1 and 2 being on the other WD USB to SATA converter?

The reason I’m asking is that I want to boot from USB with the RPI’s beta firmware a particular USB disk. I’ll swap the one I want to boot from to SATA port 2 I guess.

linux is the one naming them in the order they are detected

I’m just curios, isn’t the new firmware supposed to boot from any usb device, meaning it will search which one contains the files and boot from that, irelevant of the naming given by linux sda/sdb …

you could always specify in fstab the boot and rootfs by PARTUUID, just do a blkid and see the ID of the partitions you want and modify fstab

Yes it’s already defined by PARTUUID, but the beta USB boot firmware doesn’t boot off the Hat. I’ve tried it with just a single disk, in each of the 4 ports and the result is the same:

PM_RSTS: 0x00001000
RPi: BOOTLOADER release VERSION:23a9f59b DATE: May 15 2020 TIME: 11:05:55 BOOTMODE: 0x00000006 part: 0 BUILD_TIMESTAMP=1589537152 0xee7af503 0x00d03114
uSD voltage 3.3V
Initialising SDRAM ‘Micron’ 32Gb x2 total-size: 64 Gbit 3200
Boot mode: SD (01) order f4
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SD HOST: 250000000 CTL0: 0x00000f00 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
EMMC
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SDV1
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SD CMD: 0x371a0010 (55) 0x0 0x1fff0001
Failed to open device: ‘sdcard’ (cmd 371a0010 status 1fff0001)
Retry SD 1/1
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SD HOST: 250000000 CTL0: 0x00000f00 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
EMMC
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SDV1
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SD CMD: 0x371a0010 (55) 0x0 0x1fff0001
Failed to open device: ‘sdcard’ (cmd 371a0010 status 1fff0001)
Boot mode: USB-MSD (04) order f
VLI: HUB2: 0xfff00000 0x24e6 MCU: 0xfff20000 0x150d8
VL805 0xfff00000 0xfff20000
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ports 5 slots 32 intrs 4
USB3 rport 2 status 00000000 -> 000002a0
USB3 rport 3 status 00000000 -> 000002a0
USB3 rport 4 status 00000000 -> 000002a0
USB3 rport 5 status 00000000 -> 000002a0
USB2 rport 1 status 00000000 -> 400002e1
USB2 rport 1 status 400002f1 -> 40200e03
root HUB port 1 init
DEV [01:00] 2.16 000000:01 class 9 VID 2109 PID 3431
HUB init [01:00] 2.16 000000:01
HUB [01:00] 2.16 000000:01 init port 4 speed 1
DEV [02:01] 2.00 000004:01 class 0 VID 17ef PID 6047
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
USB MSD timed out after 10000 seconds

Maybe I have to increase the timeout.

are you on the latest beta firmware ?

Bootloader version: 2020-05-28
VL805 USB: 137ad

There are also new elf/dat files if you didn’t do a rpi-update

Good call, I wasn’t (even though I updated yesterday). But still timeout, after 10 seconds now.

you cannot boot from the hat, as the drivers need to be loaded and initialized. That happens at the end of the normal boot period, so the hat cant even be seen until Raspbian is already booted.

Yeah, I kind figured that as well. But i thought/hoped that the drivers/initialisation would just be for the OLED and fan, not for the USB to SATA converters.