>T. Horsnell wrote: >>> T. Horsnell wrote: >>>> FC6 - kernel 2.6.18-1.2798.fc6 - udev-095-14 >>>> >>>> I'm trying to develop some rules to give me device-name >>>> persistence on my SCSI disks. I have a couple of test rules: >>>> >>>> BUS=="scsi", PROGRAM="/sbin/scsi_id -g -u" >>>> RESULT=="20004cffffe0e0976", NAME="dsk0_%n", OWNER="root", GROUP="root", MODE="0700" >>>> RESULT=="SSEAGATE_ST336807LC_3KT0CTTM00007530YTR2", NAME="dsk1_%n", OWNER="root", GROUP="root", MODE="0700" >>>> >>>> With these rules disabled, I get: >>>> >>> <-------------[ SNIP ]---------------------------> >>> >>> >>>> Why have I got both sd devices and dsk devices? >>>> And what is the second line? >>>> Why have I got an entry: >>>> crw------- 1 root root 21, 0 Nov 28 11:45 /dev/dsk0_0 >>>> >>>> This looks like a generic device, but if so, why only one? >>>> And where are the normal sg devices? >>>> >>>> >>> <-------------[ SNIP ]---------------------------> >>> >>>> >>>> Is this all as expected? >>>> Am I going to be screwed later on if I need to do something >>>> that requires a generic SCSI device for a particular disk? >>>> Why do I still get /dev/sd* entries? >>>> Any clues anyone? >>>> >>>> Cheers, >>>> Terry. >>>> >>>> >>> Unless you use OPTIONS="last_rule" in your rule, both your rule and >>> the default rule will be used. So you will end up with both sets of >>> device entries. >>> >>> Now, as for the order problem, you may need to change the program >>>from "/sbin/scsi_id -g -u" to "/sbin/scsi_id -d %N -s %p" or >>> "/sbin/scsi_id -d %N -s %p -g -u". What I suspect is happening is >>> that scsi_id is not returning what you expect. From the scsi_id man >>> page: >>> >>> scsi_id is one of the tools used in the "Linux Persistent >>> Device Names" scheme that creates persistent device links in >>> /dev/disk. It is called with the -x option which will print all >>> values in a defined format to let udev import it into its own >>> environment for later event processing. >>> >>> An example custom udev rule using scsi_id, that will name a block >>> device and any partitions for the device matching the scsi_id output >>> of 312345: >>> >>> BUS=="scsi", PROGRAM=="/sbin/scsi_id -d %N -s %p", RESULT=="312345", >>> NAME="disk%n" >>> >> >> Thanks for this advice Mikkel, but so far it doesnt make any difference. >> Here's my modified ruleset: >> >> BUS=="scsi", PROGRAM="/sbin/scsi_id -d %N -s %p -g -u" >> RESULT=="20004cffffe0e0976", NAME="dsk0_%n", OWNER="root", GROUP="root", MODE="0700", OPTIONS="last_rule" >> RESULT=="SSEAGATE_ST336807LC_3KT0CTTM00007530YTR2", NAME="dsk1_%n", OWNER="root", GROUP="root", MODE="0700", OPTI$ >> >> And here's the results: >> (There is actually a small difference. I now dont have a block-device >> for dsk0, partition 1. /dev/disk0_1 has become a character device.) >> >Where did you put your rules? If the file with your rules comes >after the default rules, then both sets of rules will get used. I am >not sure why the first partition is being set as a character device. >It doesn't make sense, especially with /dev/sda1 correctly created >as a block device. [root@dev1 ~]# ls -1 /etc/udev/rules.d/ 00-lmb_scsi.rules 05-udev-early.rules 40-multipath.rules 50-udev.rules 51-hotplug.rules 60-libsane.rules 60-net.rules 60-pcmcia.rules 60-wacom.rules 90-alsa.rules 90-hal.rules 95-pam-console.rules bluetooth.rules I've tried naming my rules file lmb_scsi.rules (i.e. should be accessed last) and 00-lmb_scsi.rules (should be first). No effect. I also use things like: echo "scsi add-single-device 0 0 3 0" > /proc/scsi/scsi echo "scsi remove-single-device 0 0 3 0" > /proc/scsi/scsi to give me pseudo hotpluggable scsi disks, and if I 'remove-single-device' all my scsi disks (I boot from ide on this test box) then delete /dev/sd* and /dev/sg*, and then add all the scsi disks again using 'add-single-device', I dont get the sdX or sgX devices being recreated. Furthermore, I've since noticed that unless I have a PROGRAM statement in every rule in my ruleset, I get errors like: Dec 5 16:03:47 dev1 scsi_id[3465]: scsi_id: unable to access parent device of '/devices/pci0000:00/0000:00:0d.0/host0/target0:0:4/0:0:4:0' when I 'add-single-device' and Dec 5 16:04:29 dev1 scsi_id[3535]: scsi_id: unable to access '/devices/pci0000:00/0000:00:0d.0/host0/target0:0:4/0:0:4:0' when I 'remove-single-device' Time to set udev_log="debug" ... Cheers, Terry > >Mikkel >-- > > Do not meddle in the affairs of dragons, >for thou art crunchy and taste good with Ketchup! > >-- >fedora-list mailing list >fedora-list@xxxxxxxxxx >To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list >