Hi Robby!
I'll try to be not too redundant:
SATA disks in my system:
sda with sda1, sda2 and sda3 (Samsung SATA disk)
sdb with sdb1 the one and only partition (WD SATA disk)
sdc with sdc1 as one and only partiton (WD SATA disk, same model as sdb)
These device names are given properly if I let udev do it's thing and both sdb and sdc are plugged in when I boot. But sdb and sdc are installed in mobile racks with a seperate power switch each - so depending on which of them are powered on at startup the device names of sdb and sdc might change.
I tried to create udev rules to assign symlinks to both sdb and sdc according to their serial numbers. It didn't work at all
. Funny thing is, if I boot without my home-made rules, "udevadm info --query=all --path=/sys/block/sd{a,b,c}" shows all information right, that means different models and/or different serial numbers for all three SATA drives. If I boot with my rules the device names (sd{a,b,c}) are ok, but udev totally messes up the symlinks. This lead to the following (from memory):
Code:
symlink linked to device
/dev/hugin --> /dev/sdc
/dev/hugin1 --> /dev/sdc1
/dev/hugin2 --> /dev/sda2
/dev/hugin3 --> /dev/sda3
sdb wasn't assigned, I guess it was overwritten by sdc. Some race condition I guess. Furthermore the udevadm command got different usb numbers, but the same output for all three SATA disks, so same model and serial number for all of them. Not quite right ...
I am not sure if I'm "allowed" to use "ENV" parts in udev rules which is what I did. It's seen in all kind of tutorials. I used it because "udevadm info --attribute-walk ..." alone didn't give any information that is unique for sdb and sdc. Funnily there *is* a unique line for each, i. e. the symlink that udev creates in /dev/disk/by-id/. These are generated from the serial number of the drive, but udevadm --atribute-walk nevertheless doesn't show them as usable.
So if I do nothing, udevadm shows the serial numbers and info right, if I use an udev rule with the serial numbers udev seems to "forget" the serial numbers.
Example of one of the two rules I used, the other one differs only in serial and device name of course:
Code:
KERNEL=="sd*", ENV{ID_SERIAL}="SATA_WDC_WD6400AAKS-_WD-WCASY3969084", NAME="%k", SYMLINK+="munin%n"
For now I have created partitions of different size on both sdb and sdc, so the following rule works. It's a rather ugly workaround IMHO:
Code:
KERNEL=="sd?1", ATTR{size}=="1250242497", SYMLINK+="munin"
If you have any question or comment, feel free to ask/write