[lug] Kernel reorders SCSI drives.

David L. Anselmi anselmi at anselmi.us
Mon Oct 30 18:14:54 MST 2006


I have a 2.6.17 box with 2 SATA drives and 1 USB drive.  They used to be 
sd[a-c] respectively.  For a while the kernel has been assigning those 
names randomly to the drives.

It would seem that udev is the way around this.  First I made a rule to 
match the USB drive and call it sdc so that sda and sdb would be free 
(they are part of a RAID so I don't really care which is which).

Then I made rules to match each drive and assign the right name.  Either 
way it seems that a rename fails (because the name is already in use?) 
so one of the drives isn't visible.

For example, if USB is sda and a SATA drive is sdc I'll get the USB 
drive called sdc but no sda*.  I can use udevinfo to see what the 
original kernel name is.  And in this case sdc will have numbers 8, 0 
and sdc1 is 8, 1 (the numbers go with the first detected drive and don't 
change when udev renames things).

I would have thought that even with all the fancy udev/hotplug stuff I'd 
still be able to use the usual names but it seems I can't.

To work around this I'm going to rename everything to something new and 
ignore the kernel's idea about names.  But it seems unnecessarily clumsy 
to have to update that list any time a new drive is added.  Anyone have 
a better way?

Thanks!
Dave



More information about the LUG mailing list