Solved: Re: [lug] Kernel reorders SCSI drives.

David L. Anselmi anselmi at anselmi.us
Tue Oct 31 22:41:38 MST 2006


David L. Anselmi wrote:
[...]
> I updated my rules to make my drives sataa, satab, and usba.  Well, the 
> USB drive gets renamed just fine (it matches on product since I have 
> more than one but they get named the same).  The SATA drives show up as 
> sda and sdb--matching on serial isn't working for them.

Happily, I'm an idiot.  Well, at least udev is smarter than I am.

So a little digging and I find that the SATA drives don't have a serial 
attribute in sysfs like the USB drive does so my rules weren't matching. 
  Turns out a scsi_id program puts that info into the environment.

Moving my renaming rules after the scsi_id program and using its 
environment solves the problem--I can have the sd? names I want even 
though the kernel reorders randomly.

udevtest told me what I needed, if I'd been smart enough to understand 
its output.  Also udevinfo -a shows what isn't available to match.  And 
--query=all shows the kernel name (regardless of changes, which match 
the block minor numbers).

I think it would be nice if the kernel cared more about hardware 
arrangement than timing on boot.  But since udev can actually get around 
it I won't complain.

Thanks for listening.
Dave



More information about the LUG mailing list