writing udev rules
I want to set my system up so when i plug it my usb hard disk, my camera, and my ipod they are always the same dev name so i can have them automounted. right now when i plug them in they always end up changing to something different than the last time i plugged them in so the fstab entry is useless. I've read some howtos on writing udev rules but i can't seem to get it going. can someone give me a hand?
|
Hi.
Here's my /etc/udev/rules.d/10-cronus.rules to start with: Code:
KERNEL=="sd?1", SYSFS{manufacturer}=="Sony", SYMLINK+="sony" The LaCie drive has two partitions (differentiated by sd?1 and sd?2). To get all the udev info for a device, run the following: Code:
udevinfo -a -p `udevinfo -q path -n /dev/DEVICE` This is the output when the LaCie drive is plugged in and is at /dev/sda, as an example: Code:
[root@cronus ~]# udevinfo -a -p `udevinfo -q path -n /dev/sda` |
Hey that helped me a lot, the only thing i can't get working is my usb card reader. Do you know how to set one of these up, if it makes it easier i only have one kind of card i need read.
|
Hi.
Plug in the card reader (and card), and post the output from: udevinfo -a -p `udevinfo -q path -n /dev/DEVICE` where DEVICE is the sdX device which appears when you plug it in. Dave |
looking at device '/block/sdb':
KERNEL=="sdb" SUBSYSTEM=="block" SYSFS{stat}==" 0 0 0 0 0 0 0 0 0 0 0" SYSFS{size}=="0" SYSFS{removable}=="1" SYSFS{range}=="16" SYSFS{dev}=="8:16" looking at device '/devices/pci0000:00/0000:00:02.2/usb1/1-5/1-5:1.0/host9/target9:0:0/9:0:0:0': ID=="9:0:0:0" BUS=="scsi" DRIVER=="sd" SYSFS{ioerr_cnt}=="0x43b3" SYSFS{iodone_cnt}=="0x43b4" SYSFS{iorequest_cnt}=="0x43b4" SYSFS{iocounterbits}=="32" SYSFS{timeout}=="30" SYSFS{state}=="running" SYSFS{rev}=="3.95" SYSFS{model}=="Flash HS-CF" SYSFS{vendor}=="Generic " SYSFS{scsi_level}=="3" SYSFS{type}=="0" SYSFS{queue_type}=="none" SYSFS{queue_depth}=="1" SYSFS{device_blocked}=="0" SYSFS{max_sectors}=="240" looking at device '/devices/pci0000:00/0000:00:02.2/usb1/1-5/1-5:1.0/host9/target9:0:0': ID=="target9:0:0" BUS=="" DRIVER=="" looking at device '/devices/pci0000:00/0000:00:02.2/usb1/1-5/1-5:1.0/host9': ID=="host9" BUS=="" DRIVER=="" looking at device '/devices/pci0000:00/0000:00:02.2/usb1/1-5/1-5:1.0': ID=="1-5:1.0" BUS=="usb" DRIVER=="usb-storage" SYSFS{modalias}=="usb:v050Dp0211d0395dc00dsc00dp00ic08isc06ip50" SYSFS{bInterfaceProtocol}=="50" SYSFS{bInterfaceSubClass}=="06" SYSFS{bInterfaceClass}=="08" SYSFS{bNumEndpoints}=="02" SYSFS{bAlternateSetting}==" 0" SYSFS{bInterfaceNumber}=="00" looking at device '/devices/pci0000:00/0000:00:02.2/usb1/1-5': ID=="1-5" BUS=="usb" DRIVER=="usb" SYSFS{configuration}=="" SYSFS{serial}=="0504062049D6" SYSFS{product}=="15 in 1 MEDIA READER USB 2.0" SYSFS{manufacturer}=="BELKIN" SYSFS{maxchild}=="0" SYSFS{version}==" 2.00" SYSFS{devnum}=="8" SYSFS{speed}=="480" SYSFS{bMaxPacketSize0}=="64" SYSFS{bNumConfigurations}=="1" SYSFS{bDeviceProtocol}=="00" SYSFS{bDeviceSubClass}=="00" SYSFS{bDeviceClass}=="00" SYSFS{bcdDevice}=="0395" SYSFS{idProduct}=="0211" SYSFS{idVendor}=="050d" SYSFS{bMaxPower}==" 96mA" SYSFS{bmAttributes}=="80" SYSFS{bConfigurationValue}=="1" SYSFS{bNumInterfaces}==" 1" looking at device '/devices/pci0000:00/0000:00:02.2/usb1': ID=="usb1" BUS=="usb" DRIVER=="usb" SYSFS{configuration}=="" SYSFS{serial}=="0000:00:02.2" SYSFS{product}=="EHCI Host Controller" SYSFS{manufacturer}=="Linux 2.6.17-gentoo-r8 ehci_hcd" SYSFS{maxchild}=="8" SYSFS{version}==" 2.00" SYSFS{devnum}=="1" SYSFS{speed}=="480" SYSFS{bMaxPacketSize0}=="64" SYSFS{bNumConfigurations}=="1" SYSFS{bDeviceProtocol}=="01" SYSFS{bDeviceSubClass}=="00" SYSFS{bDeviceClass}=="09" SYSFS{bcdDevice}=="0206" SYSFS{idProduct}=="0000" SYSFS{idVendor}=="0000" SYSFS{bMaxPower}==" 0mA" SYSFS{bmAttributes}=="e0" SYSFS{bConfigurationValue}=="1" SYSFS{bNumInterfaces}==" 1" looking at device '/devices/pci0000:00/0000:00:02.2': ID=="0000:00:02.2" BUS=="pci" DRIVER=="ehci_hcd" SYSFS{modalias}=="pci:v000010DEd000000E8sv00001043sd0000813Fbc0Csc03i20" SYSFS{local_cpus}=="1" SYSFS{irq}=="193" SYSFS{class}=="0x0c0320" SYSFS{subsystem_device}=="0x813f" SYSFS{subsystem_vendor}=="0x1043" SYSFS{device}=="0x00e8" SYSFS{vendor}=="0x10de" looking at device '/devices/pci0000:00': ID=="pci0000:00" BUS=="" DRIVER=="" |
Hi again.
Try the following: Code:
KERNEL=="sd?1", SYSFS{product}=="15 in 1 MEDIA READER USB 2.0", SYMLINK+="cardreader" Dave |
That doesn't even create device nodes
|
ORLY?
How about: Code:
KERNEL=="sd?", SYSFS{product}=="15 in 1 MEDIA READER USB 2.0", SYMLINK+="cardreader" |
I'm also trying to install a cardreader. It's a Microtech CameraMate. My system is Debian 2.6.8. When I mount the CameraMate, the mounted filesystem gives me 4 directories (001, 002, 003, 004) as well as a file named devices. None of the directories has any actual card data in it. The devices file doesn't have anything really useful, either. IOW, I can mount the device, but I can't get at the picture my camera put on it. I checked the card again on the camera, and the picture is fine. I enabled the verbose usb debugging messages, and I get "Not Ready: Medium Not Present" on the console when I insert a card in the device.
|
If you have a several-in-one card reader, you'll probably have to also set Device Drivers --> SCSI device support -->[*] Probe all LUNs on each SCSI device (kernel 2.6). These readers are usually set up with one slot as the primary slot, so if this option isn't set, you won't be able to see the other slots.
|
Quote:
|
All times are GMT -5. The time now is 12:10 AM. |