Loading ...
Sorry, an error occurred while loading the content.

Problems with udev rules

Expand Messages
  • mikeycrawford
    Hi all, am the owner of an nslu2 running SlugOS, and very good it is too. My config is that I have the system drive (20Gb maxtor through USD-IDE connector)
    Message 1 of 2 , Jul 5, 2008
    • 0 Attachment
      Hi all,

      am the owner of an nslu2 running SlugOS, and very good it is too. My
      config is that I have the system drive (20Gb maxtor through USD-IDE
      connector) attached to Disk 1 and a 7 port hub on Disk 2.

      Into the hub I will be plugging in a number of usb hard disks. At
      the moment I only have two thing attached while I try and get udev
      working as I want, a 60Gb sumvision 2.5" usb hard disk and a Memory
      card reader with a 1GB SD card attached.

      in /etc/udev/rules.d/10-local.rules I have the following rule setup


      SUBSYSTEMS=="scsi", DRIVERS=="sd", ATTRS(vendor)=="Generic*", ATTRS
      (model)=="USB Disk*", NAME="sumvision%n"

      but my problem is that it seems to be the card reader, and sometimes
      even the system drive, that is getting picked up by this rule, not
      the sumvision drive, so /media/sumvision1 points to the card reader,
      and /media/sdb1 is the 60gb sumvision. I have tried various
      different combinations of keys, e.g ATTR(size) but with the same
      problems.

      the outputs from udevinfo for both devices is listed below.

      Where am I going wrong?

      TIA

      Mike

      my 60gb sumvision drive


      looking at device '/block/sdb':
      KERNEL=="sdb"
      SUBSYSTEM=="block"
      DRIVER==""
      ATTR{stat}==" 41 648 949 1630 0
      0 0 0 0 1590 1630"
      ATTR{size}=="117210240"
      ATTR{removable}=="0"
      ATTR{range}=="16"
      ATTR{dev}=="8:16"

      looking at parent device '/devices/pci0000:00/0000:00:01.2/usb1/1-
      2/1-2.2/1-2.2:1.0/host1/target1:0:0/1:0:0:0':
      KERNELS=="1:0:0:0"
      SUBSYSTEMS=="scsi"
      DRIVERS=="sd"
      ATTRS{ioerr_cnt}=="0x0"
      ATTRS{iodone_cnt}=="0x30"
      ATTRS{iorequest_cnt}=="0x30"
      ATTRS{iocounterbits}=="32"
      ATTRS{timeout}=="30"
      ATTRS{state}=="running"
      ATTRS{rev}=="9.02"
      ATTRS{model}=="USB Disk "
      ATTRS{vendor}=="Generic "
      ATTRS{scsi_level}=="3"
      ATTRS{type}=="0"
      ATTRS{queue_type}=="none"
      ATTRS{queue_depth}=="1"
      ATTRS{device_blocked}=="0"
      ATTRS{max_sectors}=="240"

      looking at parent device '/devices/pci0000:00/0000:00:01.2/usb1/1-
      2/1-2.2/1-2.2:1.0/host1/target1:0:0':
      KERNELS=="target1:0:0"
      SUBSYSTEMS==""
      DRIVERS==""


      my card reader

      looking at device '/block/sdd':
      KERNEL=="sdd"
      SUBSYSTEM=="block"
      DRIVER==""
      ATTR{stat}==" 51 238 298 140 0
      0 0 0 0 130 140"
      ATTR{size}=="1984000"
      ATTR{removable}=="1"
      ATTR{range}=="16"
      ATTR{dev}=="8:48"

      looking at parent device '/devices/pci0000:00/0000:00:01.2/usb1/1-
      2/1-2.4/1-2.4.3/1-2.4.3:1.0/host2/target2:0:0/2:0:0:1':
      KERNELS=="2:0:0:1"
      SUBSYSTEMS=="scsi"
      DRIVERS=="sd"
      ATTRS{ioerr_cnt}=="0x1"
      ATTRS{iodone_cnt}=="0x4c"
      ATTRS{iorequest_cnt}=="0x4c"
      ATTRS{iocounterbits}=="32"
      ATTRS{timeout}=="30"
      ATTRS{state}=="running"
      ATTRS{rev}=="0.0_"
      ATTRS{model}=="CardReader SD RW"
      ATTRS{vendor}=="USB2.0 "
      ATTRS{scsi_level}=="0"
      ATTRS{type}=="0"
      ATTRS{queue_type}=="none"
      ATTRS{queue_depth}=="1"
      ATTRS{device_blocked}=="0"
      ATTRS{max_sectors}=="240"
    • Mike (mwester)
      ... Ok, the rule above will match something, but I don t see any action assocated with it. I rather suspect the following rule: SUBSYSTEM== block ,
      Message 2 of 2 , Jul 6, 2008
      • 0 Attachment
        mikeycrawford wrote:
        > Hi all,
        >
        > am the owner of an nslu2 running SlugOS, and very good it is too. My
        > config is that I have the system drive (20Gb maxtor through USD-IDE
        > connector) attached to Disk 1 and a 7 port hub on Disk 2.
        >
        > Into the hub I will be plugging in a number of usb hard disks. At
        > the moment I only have two thing attached while I try and get udev
        > working as I want, a 60Gb sumvision 2.5" usb hard disk and a Memory
        > card reader with a 1GB SD card attached.
        >
        > in /etc/udev/rules.d/10-local.rules I have the following rule setup
        >
        >
        > SUBSYSTEMS=="scsi", DRIVERS=="sd", ATTRS(vendor)=="Generic*", ATTRS
        > (model)=="USB Disk*", NAME="sumvision%n"
        >
        > but my problem is that it seems to be the card reader, and sometimes
        > even the system drive, that is getting picked up by this rule, not
        > the sumvision drive, so /media/sumvision1 points to the card reader,
        > and /media/sdb1 is the 60gb sumvision. I have tried various
        > different combinations of keys, e.g ATTR(size) but with the same
        > problems.
        >
        > the outputs from udevinfo for both devices is listed below.
        >
        > Where am I going wrong?

        Ok, the rule above will match something, but I don't see any action
        assocated with it. I rather suspect the following rule:

        SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"

        in the local.rules file in that same directory is what causes the
        mounting to occur. If you need to have special mounting happening, you
        need to read that script, and perhaps modify it to suit your needs; I
        don't think that udev rules will affect mountpoints directly.

        BTW, the above rule is from recent versions of SlugOS; you don't say
        what version so I'm assuming you're at 4.8-beta at least, right?

        Mike (mwester)
      Your message has been successfully submitted and would be delivered to recipients shortly.