[Techtalk] udev, how do I loathe thee...help please!

Carla Schroder carla at bratgrrl.com
Mon Nov 8 04:55:02 UTC 2010


hey all,

Once upon a time I had udev all figured out. I could write rules and run the 
finding-things-in-sys commands and everything.

Then the sumbitch changed.

Problem: I have an 8GB SD card formatted ext2, and I use a nice USB card 
reader. I want it to mount with read/write permissions for me, chown 
carla:carla. Because, you know, I might actually want to use it. Ideally I 
would like it to mount in my homedir rather than /media. (This is on an 
Ubuntu Lipless Lynx system or whatever the eff it is.) 

None of my old rules work, so I have been beating my poor remaining brains out 
trying to make this work. (Have I told you how tired I am of the endless 
gratuitous changes in key subsystems? No? Perhaps later.)

I have consulted man udev. I have read Akkana's excellent writings, 
http://shallowsky.com/blog/linux/kernel/lucid-udev.html

I have googled and studied and trialed and errored. I have decided that udev 
is a cruel hoax perpetrated by the Anti-Linux Coalition. Seriously folks, 
what rational person would design a storage-device mounting system of such 
capriciousness and user-hostility? Why would anyone think we want random 
mountpoints and extreme pain and suffering in configuring 
read-write-ownership?

Sorry, I do go on. Here is the final version of the rule I wrote:

KERNEL=="sd*", SUBSYSTEM=="usb", ATTRS{idVendor}=="090c", 
ATTRS{idProduct}=="6000", OWNER=="alrac", GROUP=="alrac", 
OPTIONS+="all_partitions,last_rule"

It is just as ineffective as all the others I tried. I have tried different 
filenames, from 10-local.rules to 99-local.rules. I have tried 
running 'service udev restart' and 'udevadm control --reload-rules' and 
rebooted so many times it was like being back on Windows.

Pasted below is the output of udevadm info -a -p /block/sdc. I'm not confident 
that I selected the correct KERNEL and SUBSYSTEM values, and maybe it should 
have been KERNELS?? How the eff is one to know?

Thanks in advance for wisdom, enlightenment, and cathartic rants.

best,
Carla

  looking at 
device '/devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3.1/1-3.1:1.0/host12/target12:0:0/12:0:0:0/block/sdc':
    KERNEL=="sdc"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{range}=="16"
    ATTR{ext_range}=="256"
    ATTR{removable}=="1"
    ATTR{ro}=="0"
    ATTR{size}=="15644672"
    ATTR{alignment_offset}=="0"
    ATTR{capability}=="53"
    ATTR{stat}=="     128       33      688      180        1        0        
8       10        0      110      190"
    ATTR{inflight}=="       0        0"

  looking at parent 
device '/devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3.1/1-3.1:1.0/host12/target12:0:0/12:0:0:0':
    KERNELS=="12:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sd"
    ATTRS{device_blocked}=="0"
    ATTRS{type}=="0"
    ATTRS{scsi_level}=="0"
    ATTRS{vendor}=="Generic "
    ATTRS{model}=="                "
    ATTRS{rev}=="6000"
    ATTRS{state}=="running"
    ATTRS{timeout}=="30"
    ATTRS{iocounterbits}=="32"
    ATTRS{iorequest_cnt}=="0x72c"
    ATTRS{iodone_cnt}=="0x72c"
    ATTRS{ioerr_cnt}=="0x2"
    ATTRS{modalias}=="scsi:t-0x00"
    ATTRS{evt_media_change}=="0"
    ATTRS{dh_state}=="detached"
    ATTRS{queue_depth}=="1"
    ATTRS{queue_type}=="none"
    ATTRS{max_sectors}=="240"

  looking at parent 
device '/devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3.1/1-3.1:1.0/host12/target12:0:0':
    KERNELS=="target12:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent 
device '/devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3.1/1-3.1:1.0/host12':
    KERNELS=="host12"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent 
device '/devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3.1/1-3.1:1.0':
    KERNELS=="1-3.1: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:v090Cp6000d0100dc00dsc00dp00ic08isc06ip50"
    ATTRS{supports_autosuspend}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:12.2/usb1/1-3/1-3.1':
    KERNELS=="1-3.1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="80"
    ATTRS{bMaxPower}=="500mA"
    ATTRS{urbnum}=="3843"
    ATTRS{idVendor}=="090c"
    ATTRS{idProduct}=="6000"
    ATTRS{bcdDevice}=="0100"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="11"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Generic       ,   . "
    ATTRS{product}=="USB2.0 Card Reader  "
    ATTRS{serial}=="12345678901234567890"

  looking at parent device '/devices/pci0000:00/0000:00:12.2/usb1/1-3':
    KERNELS=="1-3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{urbnum}=="209"
    ATTRS{idVendor}=="058f"
    ATTRS{idProduct}=="6254"
    ATTRS{bcdDevice}=="0100"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="2"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="4"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:12.2/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="41"
    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}=="6"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.32-25-generic ehci_hcd"
    ATTRS{product}=="EHCI Host Controller"
    ATTRS{serial}=="0000:00:12.2"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:12.2':
    KERNELS=="0000:00:12.2"
    SUBSYSTEMS=="pci"
    DRIVERS=="ehci_hcd"
    ATTRS{vendor}=="0x1002"
    ATTRS{device}=="0x4396"
    ATTRS{subsystem_vendor}=="0x1043"
    ATTRS{subsystem_device}=="0x8389"
    ATTRS{class}=="0x0c0320"
    ATTRS{irq}=="17"
    ATTRS{local_cpus}=="00000000,00000007"
    ATTRS{local_cpulist}=="0-2"
    ATTRS{modalias}=="pci:v00001002d00004396sv00001043sd00008389bc0Csc03i20"
    ATTRS{numa_node}=="0"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""
    ATTRS{companion}==""

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




-- 
======================
Shiny new "Book of Audacity" 
comes out in January!
http://nostarch.com/audacity.htm

check out my books!
Linux Cookbook
http://oreilly.com/catalog/9780596006402/
Linux Networking Cookbook
http://oreilly.com/catalog/9780596102487/
======================



More information about the Techtalk mailing list