[CentOS] Static assignment of SCSI device names?

Sat Jan 29 00:28:09 UTC 2011
Chuck Munro <chuckm at seafoam.net>

> Les Mikesell kindly wrote:
>> >
>> >  Identifying drives by their ID string (which includes the drive's serial
>> >  number) and assigning names in the rules works ok.   BUT, what happens
>> >  when I have to swap out a failed drive?  The serial number (and possibly
>> >  model number) changes, and the udev assignment should fail, probably
>> >  assigning an unexpected /dev/sd? name.  RAID rebuild would choke until I
>> >  change the MD device assignment.
> If you can figure things out for the initial md device creation,
> subsequent assembly uses the uuid to match up the members and doesn't
> care if the disks have been moved around either physically or by
> detection order.  And if you are hot-swapping drives and rebuilding
> manually, you should be able to find the just-assigned name with 'dmesg'.
>

That's how I've been doing it with the two RAID-6 servers I have now, 
but in my advanced age I'm getting lazy.  I did figure out how to tag 
the drive by path using the '-i' option to scsi_id and filtering by a 
"RESULT==<path> *" expression.  However, something has gone very much 
astray, because now the rules don't do anything ... the system assigns 
names in the order scanned despite having added the udev rules before 
the default '50-udev.rules' is executed.  I'm a bit mystified by this.  
Before I started messing around, filtering by drive id string did work, 
now it doesn't.  Is there a small database somewhere I need to trash?

Mike's suggestion is intriguing and makes me wonder if I can manually 
label a replacement drive with the same UUID as the failed one (assuming 
I keep records, of course).  Since all drives in the array are 
partitioned exactly the same way, I can have one or two spares on the 
shelf pre-partitioned, ready to be given a UUID.  I don't plan to hot swap.

Still, I'd love to be able to use udev rules to assign names, if only to 
make life easier ... inquiring minds need to know why I suddenly can't 
get any rules to work.  Maybe I need to re-install.  I have just 
downloaded a trial version of RHEL-6 which I should try, to see if it 
handles this stuff more gracefully.  It'll do for experimentation until 
CentOS-6 arrives.

Chuck