[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Udev and storage devices



Howdy list,

I just installed udev on a Debian Sarge box. Everything's working
great, but now I'm trying to write some rules for a digital camera and
a usb memory stick. I created a file named 010_local.rules
in /etc/udev/rules.d that contains the following:

# Olympus D390 digital camera
BUS="scsi", SYSFS{vendor}="OLYMPUS ", KERNEL="sd*", NAME="%k",
SYMLINK="camera%n"

# PNY Attache usb key
BUS="usb", SYSFS{product}="USB Flash Memory", KERNEL="sd*", NAME="%k",
SYMLINK="usb_key%n"

However, it is symlinking both devices to /dev/camera, instead of
/dev/camera and /dev/usb_key. I've copied the output from udevinfo below
for each device. Can anyone see what I'm doing wrong? 

TIA,
Jacob

# Digital camera
device '/sys/block/sdb' has major:minor 8:16
  looking at class device '/sys/block/sdb':
    SUBSYSTEM="block"
    SYSFS{dev}="8:16"
    SYSFS{range}="16"
    SYSFS{removable}="1"
    SYSFS{size}="512000"
    SYSFS{stat}="       1        0        8       20        0
0        0        0        0       20       20"

follow the class device's "device"
  looking at the device chain at
'/sys/devices/pci0000:00/0000:00:02.0/usb1/1-3/1-3:1.0/host4/4:0:0:0':
BUS="scsi" ID="4:0:0:0"
    DRIVER="sd"
    SYSFS{detach_state}="0"
    SYSFS{device_blocked}="0"
    SYSFS{max_sectors}="240"
    SYSFS{model}="C150,D390       "
    SYSFS{queue_depth}="1"
    SYSFS{rev}="1.00"
    SYSFS{scsi_level}="3"
    SYSFS{state}="running"
    SYSFS{timeout}="30"
    SYSFS{type}="0"
    SYSFS{vendor}="OLYMPUS "

  looking at the device chain at
'/sys/devices/pci0000:00/0000:00:02.0/usb1/1-3/1-3:1.0/host4': BUS=""
    ID="host4"
    DRIVER="unknown"
    SYSFS{detach_state}="0"

  looking at the device chain at
'/sys/devices/pci0000:00/0000:00:02.0/usb1/1-3/1-3:1.0': BUS="usb"
    ID="1-3:1.0"
    DRIVER="usb-storage"
    SYSFS{bAlternateSetting}=" 0"
    SYSFS{bInterfaceClass}="08"
    SYSFS{bInterfaceNumber}="00"
    SYSFS{bInterfaceProtocol}="50"
    SYSFS{bInterfaceSubClass}="06"
    SYSFS{bNumEndpoints}="02"
    SYSFS{detach_state}="0"
    SYSFS{iInterface}="00"

  looking at the device chain at
'/sys/devices/pci0000:00/0000:00:02.0/usb1/1-3': BUS="usb"
    ID="1-3"
    DRIVER="usb"
    SYSFS{bConfigurationValue}="1"
    SYSFS{bDeviceClass}="00"
    SYSFS{bDeviceProtocol}="00"
    SYSFS{bDeviceSubClass}="00"
    SYSFS{bMaxPower}="100mA"
    SYSFS{bNumConfigurations}="1"
    SYSFS{bNumInterfaces}=" 1"
    SYSFS{bcdDevice}="0100"
    SYSFS{bmAttributes}="c0"
    SYSFS{detach_state}="0"
    SYSFS{devnum}="2"
    SYSFS{idProduct}="0102"
    SYSFS{idVendor}="07b4"
    SYSFS{manufacturer}="OLYMPUS"
    SYSFS{maxchild}="0"
    SYSFS{product}="C150,D390"
    SYSFS{serial}="S401002027"
    SYSFS{speed}="12"
    SYSFS{version}=" 1.10"

  looking at the device chain at
'/sys/devices/pci0000:00/0000:00:02.0/usb1': BUS="usb"
    ID="usb1"
    DRIVER="usb"
    SYSFS{bConfigurationValue}="1"
    SYSFS{bDeviceClass}="09"
    SYSFS{bDeviceProtocol}="00"
    SYSFS{bDeviceSubClass}="00"
    SYSFS{bMaxPower}="  0mA"
    SYSFS{bNumConfigurations}="1"
    SYSFS{bNumInterfaces}=" 1"
    SYSFS{bcdDevice}="0206"
    SYSFS{bmAttributes}="e0"
    SYSFS{detach_state}="0"
    SYSFS{devnum}="1"
    SYSFS{idProduct}="0000"
    SYSFS{idVendor}="0000"
    SYSFS{manufacturer}="Linux 2.6.8-2-k7 ohci_hcd"
    SYSFS{maxchild}="3"
    SYSFS{product}="nVidia Corporation nForce2 USB Controller"
    SYSFS{serial}="0000:00:02.0"
    SYSFS{speed}="12"
    SYSFS{version}=" 1.10"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.0':
    BUS="pci"
    ID="0000:00:02.0"
    DRIVER="ohci_hcd"
    SYSFS{class}="0x0c0310"
    SYSFS{detach_state}="0"
    SYSFS{device}="0x0067"
    SYSFS{irq}="177"
    SYSFS{subsystem_device}="0x5004"
    SYSFS{subsystem_vendor}="0x1458"
    SYSFS{vendor}="0x10de"

  looking at the device chain at '/sys/devices/pci0000:00':
    BUS=""
    ID="pci0000:00"
    DRIVER="unknown"
    SYSFS{detach_state}="0"


# USB key
device '/sys/block/sdb' has major:minor 8:16
  looking at class device '/sys/block/sdb':
    SUBSYSTEM="block"
    SYSFS{dev}="8:16"
    SYSFS{range}="16"
    SYSFS{removable}="1"
    SYSFS{size}="1001472"
    SYSFS{stat}="       1        0        8        1        0
0        0        0        0        1        1"

follow the class device's "device"
  looking at the device chain at
'/sys/devices/pci0000:00/0000:00:02.2/usb3/3-6/3-6:1.0/host7/7:0:0:0':
BUS="scsi" ID="7:0:0:0"
    DRIVER="sd"
    SYSFS{detach_state}="0"
    SYSFS{device_blocked}="0"
    SYSFS{max_sectors}="240"
    SYSFS{model}="USB Flash Memory"
    SYSFS{queue_depth}="1"
    SYSFS{rev}="1.00"
    SYSFS{scsi_level}="3"
    SYSFS{state}="running"
    SYSFS{timeout}="30"
    SYSFS{type}="0"
    SYSFS{vendor}="        "

  looking at the device chain at
'/sys/devices/pci0000:00/0000:00:02.2/usb3/3-6/3-6:1.0/host7': BUS=""
    ID="host7"
    DRIVER="unknown"
    SYSFS{detach_state}="0"

  looking at the device chain at
'/sys/devices/pci0000:00/0000:00:02.2/usb3/3-6/3-6:1.0': BUS="usb"
    ID="3-6:1.0"
    DRIVER="usb-storage"
    SYSFS{bAlternateSetting}=" 0"
    SYSFS{bInterfaceClass}="08"
    SYSFS{bInterfaceNumber}="00"
    SYSFS{bInterfaceProtocol}="50"
    SYSFS{bInterfaceSubClass}="06"
    SYSFS{bNumEndpoints}="03"
    SYSFS{detach_state}="0"
    SYSFS{iInterface}="00"

  looking at the device chain at
'/sys/devices/pci0000:00/0000:00:02.2/usb3/3-6': BUS="usb"
    ID="3-6"
    DRIVER="usb"
    SYSFS{bConfigurationValue}="1"
    SYSFS{bDeviceClass}="00"
    SYSFS{bDeviceProtocol}="00"
    SYSFS{bDeviceSubClass}="00"
    SYSFS{bMaxPower}="100mA"
    SYSFS{bNumConfigurations}="1"
    SYSFS{bNumInterfaces}=" 1"
    SYSFS{bcdDevice}="0100"
    SYSFS{bmAttributes}="80"
    SYSFS{detach_state}="0"
    SYSFS{devnum}="9"
    SYSFS{idProduct}="6533"
    SYSFS{idVendor}="0930"
    SYSFS{manufacturer}=""
    SYSFS{maxchild}="0"
    SYSFS{product}="USB Flash Memory"
    SYSFS{speed}="480"
    SYSFS{version}=" 2.00"

  looking at the device chain at
'/sys/devices/pci0000:00/0000:00:02.2/usb3': BUS="usb"
    ID="usb3"
    DRIVER="usb"
    SYSFS{bConfigurationValue}="1"
    SYSFS{bDeviceClass}="09"
    SYSFS{bDeviceProtocol}="01"
    SYSFS{bDeviceSubClass}="00"
    SYSFS{bMaxPower}="  0mA"
    SYSFS{bNumConfigurations}="1"
    SYSFS{bNumInterfaces}=" 1"
    SYSFS{bcdDevice}="0206"
    SYSFS{bmAttributes}="e0"
    SYSFS{detach_state}="0"
    SYSFS{devnum}="1"
    SYSFS{idProduct}="0000"
    SYSFS{idVendor}="0000"
    SYSFS{manufacturer}="Linux 2.6.8-2-k7 ehci_hcd"
    SYSFS{maxchild}="6"
    SYSFS{product}="nVidia Corporation nForce2 USB Controller"
    SYSFS{serial}="0000:00:02.2"
    SYSFS{speed}="480"
    SYSFS{version}=" 2.00"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.2':
    BUS="pci"
    ID="0000:00:02.2"
    DRIVER="ehci_hcd"
    SYSFS{class}="0x0c0320"
    SYSFS{detach_state}="0"
    SYSFS{device}="0x0068"
    SYSFS{irq}="193"
    SYSFS{subsystem_device}="0x5004"
    SYSFS{subsystem_vendor}="0x1458"
    SYSFS{vendor}="0x10de"

  looking at the device chain at '/sys/devices/pci0000:00':
    BUS=""
    ID="pci0000:00"
    DRIVER="unknown"
    SYSFS{detach_state}="0"



Reply to: