ata controller problem / AHCI numbering

Lucas B. Cohen lbc at
Sat Oct 27 15:43:28 UTC 2012

On 2012.10.26 14:18, Gerhard Schmidt wrote:
>> if there is a Drive in one of the HotSwap Bays the
>> PCI-Express controller is detected as ahci0 and the onboard is detected
>> as ahci1.

>> So Far i could have set some devices.hints entries to sort the scsi
>> busses. But the problem is that if there are no drives in the Bays the
>> PCI-Expresscard is detected as ahci1

On 2012.10.27 10:22, Gerhard Schmidt wrote:
> Am 26.10.2012 18:33, schrieb Jeremy Chadwick:

>> The proper way to solve this problem is to user /boot/loader.conf
>> tie-downs to assign each disk to each individual controllers' device
>> number (e.g. ada0 --> scbus0 --> ahcich0, or whatever you want).  Please
>> note I said ahcichX, not ahciX.  Different things.

> Sorry this doesn't work because the numbering of the ahci change with
> the occupancy of the Hot-Swap Bays.

I'm surprised and curious about this...

Don't all devices, including SATA/AHCI controllers, get probed and
numbered in the order they are presented to a kernel ?

What can cause that presentation order to vary when physical connections
don't change ?

How could even an intrusive x86 BIOS "feature" change that presentation
order based on whether or not a disk is connected to a peripheral device
? Doesn't a BIOS stay ignorant of what is plugged into external
controllers, which have their own boot ROM ?

Certainly FreeBSD's kernel would not bother to reorder device numbers
based on what is connected to them lower down the chain after it's
discovered these "children", right ? (I'd be curious to take a look at
your dmesg, Gerhard)

I wish I could test this and figure it out on my own, but I don't have
the right hardware available to replicate it and VirtualBox only
supports a single virtual SATA controller. Using two identical (crappy)
ASMedia AHCI 6Gbps PCIe adapters, I wasn't able to get their ahci
numbering reversed by plugging or unplugging disks from them before
booting. But the mainboard's SATA controllers are driven by atapci
instead of ahci, so it's not quite the same...

More information about the freebsd-questions mailing list