[NTLUG:Discuss] udev rule didn't run -- but should have..

Richard Geoffrion ntlug at rain4us.net
Tue Mar 28 10:04:00 CST 2006


Issue:  Plugging in a 160gig Seagate USB hard drive into Slackware 
10.2-current, UDEV version 087, Kernel 2.6.15.6-skas3-v9-pre8, didn't 
create the /dev/sdb device node.

Results from /var/log/messages showed that it saw sdb AND sdb1,

</var/log/messages snippet>
kernel: usb 1-4: new high speed USB device using ehci_hcd and address 3
kernel: Initializing USB Mass Storage driver...
kernel: scsi1 : SCSI emulation for USB Mass Storage devices
kernel: usbcore: registered new driver usb-storage
kernel: USB Mass Storage support registered.
kernel:   Vendor: ST316002  Model: 3A                Rev:  0 0
kernel:   Type:   Direct-Access                      ANSI SCSI revision: 00
kernel: SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB)
kernel: SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB)
kernel:  sdb: sdb1
kernel: sd 1:0:0:0: Attached scsi disk sdb
</snippet>

but it didn't create the /dev/device_nodes

<no sdb or sdb1 here!>
/dev# ls -l sd*
brw-rw---- 1 root disk 8,  0 2006-03-20 17:27 sda
brw-rw---- 1 root disk 8,  1 2006-03-20 17:27 sda1
brw-rw---- 1 root disk 8, 10 2006-03-20 17:27 sda10
brw-rw---- 1 root disk 8,  2 2006-03-20 17:27 sda2
brw-rw---- 1 root disk 8,  3 2006-03-20 17:27 sda3
brw-rw---- 1 root disk 8,  4 2006-03-20 17:27 sda4
brw-rw---- 1 root disk 8,  5 2006-03-20 17:27 sda5
brw-rw---- 1 root disk 8,  6 2006-03-20 17:27 sda6
brw-rw---- 1 root disk 8,  7 2006-03-20 17:27 sda7
brw-rw---- 1 root disk 8,  8 2006-03-20 17:27 sda8
brw-rw---- 1 root disk 8,  9 2006-03-20 17:27 sda9
</missing sdb>

I wrote a UDEV rule to put above the one provided and it corrected my 
situation.

#My inserted custom rule for USB Hard drive placed directly above
# the other sd rule
BUS=="usb", DRIVER=="usb-storage", KERNEL="sd*",  NAME="%k", GROUP="disk"

# The original system rule that didn't work...
# disk devices
KERNEL="sd*",           NAME="%k", GROUP="disk"

My question is....WHY didn't the system rule work?  Certainly my rule 
only appears to be a duplicate, yet it was necessary.   The system rule 
states,  If kernel device starts with sd, then a device node will be 
created and named whatever the default %kernel name is (in this 
case...sdb and sdb1) .

My rule contains further restrictions, yet it seems to be run?   So why 
didn't the system one run?

-- 
Richard




More information about the Discuss mailing list