Hi I have an external drive that I would like mounted with HAL, so
that it doesn't mount on boot (which takes ages for it to spin up) and
so that I can add and remove it easily.

As I understand it udev rules are the way of doing this.

I have spent quite a while reading about these and understand roughly
what i want but I can't get any response from the changes I have made
(and have had to guess about things I don't want to guess about) so
how do I set them:

My guess to see if I can select the right drive
/etc/udev/rules.d/10-local.rules:

SUBSYSTEMS=="block", ATTRS{serial}=="2HBEQTN2", KERNEL=="sd?",
NAME="%k", SYMLINK+="external", GROUP="storage"
SUBSYSTEMS=="scsi", ATTRS{serial}=="2HBEQTN2",KERNEL=="sd?1",
SYMLINK+="external", GROUP="storage"


Produces no /dev/external when I restart HALD

This is the info about my drive:

$ /sbin/udevadm info -a -p $(/sbin/udevadm info -q path -n /dev/sdb)

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

 looking at device
'/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0/host4/target4:0:0/4:0:0:0/block/sdb':
   KERNEL=="sdb"
   SUBSYSTEM=="block"
   DRIVER==""
   ATTR{range}=="16"
   ATTR{ext_range}=="256"
   ATTR{removable}=="0"
   ATTR{ro}=="0"
   ATTR{size}=="976773168"
   ATTR{alignment_offset}=="0"
   ATTR{capability}=="52"
   ATTR{stat}=="     295      954     4852    38240       14        1
    120       10        0    38130    38250"

 looking at parent device
'/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0/host4/target4:0:0/4:0:0:0':
   KERNELS=="4:0:0:0"
   SUBSYSTEMS=="scsi"
   DRIVERS=="sd"
   ATTRS{device_blocked}=="0"
   ATTRS{type}=="0"
   ATTRS{scsi_level}=="3"
   ATTRS{vendor}=="Maxtor  "
   ATTRS{model}=="Basics Desktop  "
   ATTRS{rev}=="0122"
   ATTRS{state}=="running"
   ATTRS{timeout}=="30"
   ATTRS{iocounterbits}=="32"
   ATTRS{iorequest_cnt}=="0x14f"
   ATTRS{iodone_cnt}=="0x14f"
   ATTRS{ioerr_cnt}=="0x9"
   ATTRS{modalias}=="scsi:t-0x00"
   ATTRS{evt_media_change}=="0"
   ATTRS{queue_depth}=="1"
   ATTRS{queue_type}=="none"
   ATTRS{max_sectors}=="240"

 looking at parent device
'/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0/host4/target4:0:0':
   KERNELS=="target4:0:0"
   SUBSYSTEMS=="scsi"
   DRIVERS==""

 looking at parent device
'/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0/host4':
   KERNELS=="host4"
   SUBSYSTEMS=="scsi"
   DRIVERS==""

 looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0':
   KERNELS=="1-2:1.0"
   SUBSYSTEMS=="usb"
   DRIVERS=="usb-storage"
   ATTRS{bInterfaceNumber}=="00"
   ATTRS{bAlternateSetting}==" 0"
   ATTRS{bNumEndpoints}=="02"
   ATTRS{bInterfaceClass}=="08"
   ATTRS{bInterfaceSubClass}=="06"
   ATTRS{bInterfaceProtocol}=="50"
   ATTRS{modalias}=="usb:v0D49p7410d0122dc00dsc00dp00ic08isc06ip50"
   ATTRS{supports_autosuspend}=="0"

 looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-2':
   KERNELS=="1-2"
   SUBSYSTEMS=="usb"
   DRIVERS=="usb"
   ATTRS{configuration}==""
   ATTRS{bNumInterfaces}==" 1"
   ATTRS{bConfigurationValue}=="1"
   ATTRS{bmAttributes}=="c0"
   ATTRS{bMaxPower}=="  2mA"
   ATTRS{urbnum}=="1392"
   ATTRS{idVendor}=="0d49"
   ATTRS{idProduct}=="7410"
   ATTRS{bcdDevice}=="0122"
   ATTRS{bDeviceClass}=="00"
   ATTRS{bDeviceSubClass}=="00"
   ATTRS{bDeviceProtocol}=="00"
   ATTRS{bNumConfigurations}=="1"
   ATTRS{bMaxPacketSize0}=="64"
   ATTRS{speed}=="480"
   ATTRS{busnum}=="1"
   ATTRS{devnum}=="2"
   ATTRS{version}==" 2.00"
   ATTRS{maxchild}=="0"
   ATTRS{quirks}=="0x0"
   ATTRS{authorized}=="1"
   ATTRS{manufacturer}=="Maxtor  "
   ATTRS{product}=="Basics Desktop  "
   ATTRS{serial}=="2HBEQTN2    "

 looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1':
   KERNELS=="usb1"
   SUBSYSTEMS=="usb"
   DRIVERS=="usb"
   ATTRS{configuration}==""
   ATTRS{bNumInterfaces}==" 1"
   ATTRS{bConfigurationValue}=="1"
   ATTRS{bmAttributes}=="e0"
   ATTRS{bMaxPower}=="  0mA"
   ATTRS{urbnum}=="40"
   ATTRS{idVendor}=="1d6b"
   ATTRS{idProduct}=="0002"
   ATTRS{bcdDevice}=="0206"
   ATTRS{bDeviceClass}=="09"
   ATTRS{bDeviceSubClass}=="00"
   ATTRS{bDeviceProtocol}=="00"
   ATTRS{bNumConfigurations}=="1"
   ATTRS{bMaxPacketSize0}=="64"
   ATTRS{speed}=="480"
   ATTRS{busnum}=="1"
   ATTRS{devnum}=="1"
   ATTRS{version}==" 2.00"
   ATTRS{maxchild}=="10"
   ATTRS{quirks}=="0x0"
   ATTRS{authorized}=="1"
   ATTRS{manufacturer}=="Linux 2.6.31-gentoo-r10 ehci_hcd"
   ATTRS{product}=="EHCI Host Controller"
   ATTRS{serial}=="0000:00:02.1"
   ATTRS{authorized_default}=="1"

 looking at parent device '/devices/pci0000:00/0000:00:02.1':
   KERNELS=="0000:00:02.1"
   SUBSYSTEMS=="pci"
   DRIVERS=="ehci_hcd"
   ATTRS{vendor}=="0x10de"
   ATTRS{device}=="0x005b"
   ATTRS{subsystem_vendor}=="0x1043"
   ATTRS{subsystem_device}=="0x815a"
   ATTRS{class}=="0x0c0320"
   ATTRS{irq}=="21"
   ATTRS{local_cpus}=="ffffffff"
   ATTRS{local_cpulist}=="0-31"
   ATTRS{modalias}=="pci:v000010DEd0000005Bsv00001043sd0000815Abc0Csc03i20"
   ATTRS{broken_parity_status}=="0"
   ATTRS{msi_bus}==""
   ATTRS{companion}==""

 looking at parent device '/devices/pci0000:00':
   KERNELS=="pci0000:00"
   SUBSYSTEMS==""
   DRIVERS==""

Reply via email to