I am currently using OpenWRT v24.10.0-rc2 on x86 with kernel version
root@Xi3-OpenWRT:/# uname -r
6.6.63
and I have a 4 bay eSATA HDD enclosure. If I put only a single HDD in the enclosure, it works perfectly, but if I put all 4 drives in, only the 1st drive is detected. I’m assuming it’s related to SATA port multiplexing not being enabled in the kernel? But, I am very much a linux noob. My questions are as follows:
Is SATA multiplexing (option_sata_pmp=y) enabled in the default shipped kernel? I’ve found some threads here suggesting that it is, but I am not sure.
Is there a way I can see what options were used to compile my kernel?
I do have the option of using USB, but for my specific HW platform (Xi3 Zero Pro), I’d be limited to USB 2.0.
Thanks in advanced for anyone who knows better than I.
UPDATE: New info: when I do lspci, I get:
root@Xi3-OpenWRT:~# lspci
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
but, when I do:
root@Xi3-OpenWRT:~# opkg list | grep kmod-ata
kmod-ata-ahci - 6.6.63-r1 - Support for AHCI Serial ATA controllers
kmod-ata-artop - 6.6.63-r1 - PATA support for ARTOP 6210/6260 host controllers
kmod-ata-core - 6.6.63-r1 - Serial and Parallel ATA support
kmod-ata-dwc - 6.6.63-r1 - Platform support for the on-chip SATA controller.
kmod-ata-nvidia-sata - 6.6.63-r1 - Nvidia Serial ATA support
kmod-ata-pdc202xx-old - 6.6.63-r1 - This option enables support for the Promise 20246, 20262, 20263, 20265 and 20267 adapters
kmod-ata-piix - 6.6.63-r1 - SATA support for Intel ICH5/6/7/8 series host controllers and PATA support for Intel ESB/ICH/PIIX3/PIIX4 series host controllers
kmod-ata-sil - 6.6.63-r1 - Support for Silicon Image Serial ATA controllers
kmod-ata-sil24 - 6.6.63-r1 - Support for Silicon Image 3124/3132 Serial ATA controllers
kmod-ata-via-sata - 6.6.63-r1 - This option enables support for VIA Serial ATA
It seems I don’t have any kmod modules for SATA devices, but I am booting to an internal M.2. SATA drive, and like I mentioned, the external enclosure works w/ only 1 drive installed…
That’s a really good idea. I think I have a live Linux distro on a USB stick I used to dd the OpenWRT image to the device to begin with.
Also, I hadn’t thought of the RAID option in BIOS. I’ll have a look at it in the morning. Too tired tonight. I did find that the ahci driver seems to be built into the kernel (that is lspci -vv shows my controller is using the ahci driver) so that’s how it’s working for the M.2. SATA w/o the kmod-ata-ahci module installed. I hope this is correct to say it this way…
@frollic Yes, I know, I have a docker I’d rather not lose, though just today I was thinking of a way I could back it up, so I may upgrade if I can’t get it figured out.
Hmm, that’s an interesting idea too… I guess I’d wonder if anyone could confirm that SATA multiplexing works w/ the stock kernel on any hardware set? If I could scratch that off the list of possible causes, it’d help a lot.
The config changes used for compiling that version can be found at https://downloads.openwrt.org/releases/24.10.0-rc2/targets/x86/64/ in config.buildinfo (I'm assume x86/64; if not, jump up one dir and over to the correct variant). For the full config, you could grab the image builder (or the docker container for it), search for the kernel .config and look at that.
~/openwrt/openwrt# podman run -it ghcr.io/openwrt/imagebuilder:x86-64-24.10.0-rc2
buildbot@b6804a9604e6:~$ grep -i pmp ./build_dir/target-x86_64_musl/linux-x86_64/linux-6.6.63/.config
# CONFIG_SATA_PMP is not set
So, looks like it's off by default.
I'd be inclined to see if that's the needed kmod, opkg install kmod-ata-ahci && modprobe ata_ahci or something like that?
I am not well versed in Linux – is it appropriate the install a kmod driver when the driver seems to be in the kernel already? This brings to mind the obvious question of why the kmod-ata-ahci would even be in the repository if it’s not needed w/ the stock kernel – so it seems to me that the kmod package must have its purpose, maybe the built in kernel driver is a stripped down version? I can’t say too much here. Maybe you know more.
OpenWrt's kernel is pretty stripped down, all the "extra" stuff is in loadable kmods, with only a handful delivered by default to either 1) match an embedded device's actual hardware, or 2) on our x86s, not flood the system with unneeded junk.
Not likely, I'm just guessing at what I'd try based on that output from lspci...
This sounds plausible. I’ll look into this and try all these good ideas tomorrow morning and report back. Thank you to everyone who contributed to the troubleshooting here. Much appreciated.
I installed kmod-ata-ahci which auto-installed kmod-ata-core w/ no change. Only first eSATA HDD is detected. Looking in /lib/modules/6.6.63/ I do not see any ata_ahci or any other added .ko file, so I am not sure what this did.
Looking in the BIOS, it seems my options are limited. I only have boot-order options for disk drives. No AHCI / RAID mode toggle option.
Curiously, I found an “Enable USB 3.0” option in the BIOS. It was enabled, and kmod-usb-xhci-hcd is installed, but only OHCI and EHCI controllers show up in either lsusb or lspci. Interestingly, googling my HW is inconclusive. Some websites say it has 3.0, others don’t, but importantly the datasheet put out by Xi3 (the manufacturer) says “4x eSATAp/USB2.0 combo ports” so maybe they’d originally intended on including 3.0 but couldn’t for some reason.
Still left to do:
See if the eSATA multiplexed drives show up in BIOS