2007-01-21 00:23:47

by Patrick Ale

[permalink] [raw]
Subject: pata_sil680 module, udev and changing drive node order

Hi all,

I am using kernel 2.6.19 with the new pata and sata drivers.
First of all, the drivers work great, no crashes nothing.

There is one downside i found by using these drivers, and i am not
sure how i can fix this.

The drivers load correctly but my drives seem to be in a different
order all the time, which is not very convinient when your run md
devices.

I have a pata_via driver, which is built-in to the kernel since it
serves my primary and secundary ATA controller.
I have a pata_pdc2027x driver, serving the 3rd and 4th ATA controller
on the motherboard. (as module)
I have a pata_sil680 driver serving 2 PCI add-in cards (as module)
I have a sata_sil driver for the onboard sata controller. (as module)

What seems to happen is that either the modules are auto-loaded and
that the pata_sil680 driver changes the order of the two PCI cards
every reboot or that udev gets different events from different
controllers as first after every reboot and therefor creates the
device nodes different.

So, my question is: how do I force a fixed order for a module handling
two PCI cards, or how do I tell udev to always use the same mapping
for the device nodes in /dev?

Thanks,


2007-01-22 08:03:27

by Andre Tomt

[permalink] [raw]
Subject: Re: pata_sil680 module, udev and changing drive node order

Patrick Ale wrote:
> The drivers load correctly but my drives seem to be in a different
> order all the time, which is not very convinient when your run md
> devices.

md does not rely on device names, it can work on array UUID's too (check
out man mdadm.conf).

> So, my question is: how do I force a fixed order for a module handling
> two PCI cards, or how do I tell udev to always use the same mapping
> for the device nodes in /dev?

To avoid these kinds of pitfalls I usually only specify UUID's for mdadm
to assemble, not device-names. Mount can also work with partition UUID's
if you are not using something like devicemapper or md in between that
has a static device name scheme.

Beware that you may need a fairly modern initramfs/initrd setup to get
all this to work cleanly, especially if the root device is involved.