Using disk label on udev rules?
Hello,
Until just a few hours ago, when I plugged my external hard drive in I had to run a script to mount it with sudo, as I couldn't get it automounted. Then I saw a workaround in some thread over here, using the udev rules proposed at the bottom of the Udev wiki article.
After a reboot, and after some hours I didn't remember I had created that rule, so I went to konsole and run my script, which returned "Disc not found". That's because it checks there is that device under /dev/disk/by-label/. As I checked afterwards, the disk was automounted on some directory under /media, but it there were no symlinks to it nor to my pendrive under /dev/disk. This is a problem as my script did something like "mount /dev/disk/by-label/$LABEL /mnt/$LABEL", and Amarok's collection is under there, so if I change the collection directory every time I reboot (or every time I plug the disk) it might be mounted on a different directory (current one is /media/usbhd-sdb1), depending on the order I plug the usb storage devices, or even random if more than one is plugged on boot (not sure about this).
I suppose this is because when I plug the disk (or pendrive) udev applies the first rule it finds, so I think a possible workaround for my problem is to change the mount directory on the udev rule. And here is where my question comes: I see NAME="%k" and then %k used as the device name under /dev (in this case sdb1). Could I use some variable to keep the label of the disk and then mount it on /mnt/$LABEL, for example? I think this way I couldn't automount any device without label, but every pendrive I've seen is labeled by default so that wouldn't be a problem.
Thank you for reading that bible, and thank you again if you answer
Bye!
Edit: maybe this thread should be under Kernel & Hardware. If so, please move it
Last edited by Surgat_ (2008-09-02 23:52:47)
I think what you were looking for may have been $env{ID_FS_LABEL}. I've got the following as my udev rules for getting automatically mounted drives with the mountpoint set to the partition label instead of just a number. Not particularly robust when there are two partitions with the same label, but I haven't gotten around to writing a fix for it yet. If it works for you, maybe we should put it on the wiki.
KERNEL=="sd[b-z]", NAME="%k", SYMLINK+="usb%m", GROUP="users", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[b-z][0-9]", SYMLINK+="usb%n", GROUP="users", NAME="%k"
ACTION=="add", KERNEL=="sd[b-z][0-9]", RUN+="/bin/mkdir -p /mnt/usb%n"
ACTION=="add", KERNEL=="sd[b-z][0-9]", RUN+="/bin/ln -s /mnt/usb%n /media/$env{ID_FS_LABEL}"
ACTION=="add", KERNEL=="sd[b-z][0-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/%k /mnt/usb%n", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[b-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/%k /mnt/usb%n", OPTIONS="last_rule"
ACTION=="remove", KERNEL=="sd[b-z][0-9]", RUN+="/bin/umount -l /mnt/usb%n"
ACTION=="remove", KERNEL=="sd[b-z][0-9]", RUN+="/bin/rm /media/$env{ID_FS_LABEL}"
ACTION=="remove", KERNEL=="sd[b-z][0-9]", RUN+="/bin/rmdir /mnt/usb%n", OPTIONS="last_rule"
Similar Messages
-
ASMlib cannot write disk label using EMC Powerpath to disk
We installed ASMlib on OEL5 (64-bit) update 1. We configured successfully. When we are cerating the disk label using EMC powerpath to disk, oracleasm createdisk command gives an error:
Device "/dev/emcpowerb1" is not a partition
If we access the device directly without multipathing (like /dev/sdd1), it works successfully. Is this a pwoerpath bug or are we doing something wrong?Researched this a little deeper. Another Metalink Note:469163.1 "Oracleasm Createdisk Fails: Device '/dev/emcpoweraxx Is Not A Partition [Failed]" provides a different workaround to this situation:
1. Do the "/etc/init.d/oracleasm createdisk" operation using the "asmtool" command directly:
/usr/sbin/asmtool -C -l /dev/oracleasm -n <volume name> -s /dev/<emc device> -a force=yes
The tool will report:
asmtool: Device "/dev/<emc device>" is not a partition
asmtool: Continuing anyway
2. The permissions of the volume under /dev/oracleasm/disks/ will be "root: root"
Reboot the system to correct this.
3. Further use of the device can now be done normally using the powerpath device name
You may prefer this approach.
Cheers -
Udev rule to disable touchpad when usbmouse is used [solved]
Hello guys,
I tried the udev-rule from the wiki to disable/enable touchpad when my usbmouse is plugged/unplugged.
Here is the rule:
#/etc/udev/rules.d/01-touchpad.rules
ACTION=="add", SUBSYSTEM=="input", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"
ACTION=="remove", SUBSYSTEM=="input", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"
The problem is that the status of my touchpad won't change when I plug/unplug my mouse. It has to be a problem with the rule because manually the synclient command works without any problem.
Here is the relevant output of lsusb:
Bus 007 Device 012: ID 046d:c00c Logitech, Inc. Optical Wheel Mouse
Thank you.
Last edited by orschiro (2010-03-18 15:15:10)Hello Coacher,
I did what you said but have no idea what to do with that logfile. I'll better post it here. Perhaps you could help me again.
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[1268568009.445312] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14/mouse2 (input)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14/mouse2
SUBSYSTEM=input
DEVNAME=input/mouse2
SEQNUM=48167
MAJOR=13
MINOR=34
KERNEL[1268568009.461185] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14/event14 (input)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14/event14
SUBSYSTEM=input
DEVNAME=input/event14
SEQNUM=48168
MAJOR=13
MINOR=78
KERNEL[1268568009.471273] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14 (input)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14
SUBSYSTEM=input
PRODUCT=3/46d/c00c/110
NAME="Logitech USB Mouse"
PHYS="usb-0000:00:1d.1-2/input0"
UNIQ=""
EV==17
KEY==70000 0 0 0 0
REL==103
MSC==10
MODALIAS=input:b0003v046DpC00Ce0110-e0,1,2,4,k110,111,112,r0,1,8,am4,lsfw
SEQNUM=48169
KERNEL[1268568009.471331] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0001/hidraw/hidraw0 (hidraw)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0001/hidraw/hidraw0
SUBSYSTEM=hidraw
DEVNAME=hidraw0
SEQNUM=48170
MAJOR=251
MINOR=0
KERNEL[1268568009.472063] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0001 (hid)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0001
SUBSYSTEM=hid
HID_ID=0003:0000046D:0000C00C
HID_NAME=Logitech USB Mouse
HID_PHYS=usb-0000:00:1d.1-2/input0
MODALIAS=hid:b0003v0000046Dp0000C00C
SEQNUM=48171
KERNEL[1268568009.472116] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0 (usb)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0
SUBSYSTEM=usb
DEVTYPE=usb_interface
DEVICE=/proc/bus/usb/007/002
PRODUCT=46d/c00c/610
TYPE=0/0/0
INTERFACE=3/1/2
MODALIAS=usb:v046DpC00Cd0610dc00dsc00dp00ic03isc01ip02
SEQNUM=48172
KERNEL[1268568009.473105] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2 (usb)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2
SUBSYSTEM=usb
DEVNAME=bus/usb/007/002
DEVTYPE=usb_device
DEVICE=/proc/bus/usb/007/002
PRODUCT=46d/c00c/610
TYPE=0/0/0
BUSNUM=007
DEVNUM=002
SEQNUM=48173
MAJOR=189
MINOR=769
UDEV [1268568009.596460] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14/event14 (input)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14/event14
SUBSYSTEM=input
DEVNAME=/dev/input/event14
SEQNUM=48168
ID_INPUT=1
ID_INPUT_MOUSE=1
ID_VENDOR=Logitech
ID_VENDOR_ENC=Logitech
ID_VENDOR_ID=046d
ID_MODEL=USB_Mouse
ID_MODEL_ENC=USB\x20Mouse
ID_MODEL_ID=c00c
ID_REVISION=0610
ID_SERIAL=Logitech_USB_Mouse
ID_TYPE=hid
ID_BUS=usb
ID_USB_INTERFACES=:030102:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=usbhid
ID_PATH=pci-0000:00:1d.1-usb-0:2:1.0
MAJOR=13
MINOR=78
DEVLINKS=/dev/char/13:78 /dev/input/by-id/usb-Logitech_USB_Mouse-event-mouse /dev/input/by-path/pci-0000:00:1d.1-usb-0:2:1.0-event-mouse
UDEV [1268568009.605422] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0001/hidraw/hidraw0 (hidraw)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0001/hidraw/hidraw0
SUBSYSTEM=hidraw
DEVNAME=/dev/hidraw0
SEQNUM=48170
MAJOR=251
MINOR=0
DEVLINKS=/dev/char/251:0
UDEV [1268568009.606695] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14/mouse2 (input)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14/mouse2
SUBSYSTEM=input
DEVNAME=/dev/input/mouse2
SEQNUM=48167
ID_INPUT=1
ID_INPUT_MOUSE=1
ID_VENDOR=Logitech
ID_VENDOR_ENC=Logitech
ID_VENDOR_ID=046d
ID_MODEL=USB_Mouse
ID_MODEL_ENC=USB\x20Mouse
ID_MODEL_ID=c00c
ID_REVISION=0610
ID_SERIAL=Logitech_USB_Mouse
ID_TYPE=hid
ID_BUS=usb
ID_USB_INTERFACES=:030102:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=usbhid
ID_PATH=pci-0000:00:1d.1-usb-0:2:1.0
MAJOR=13
MINOR=34
DEVLINKS=/dev/char/13:34 /dev/input/by-id/usb-Logitech_USB_Mouse-mouse /dev/input/by-path/pci-0000:00:1d.1-usb-0:2:1.0-mouse
UDEV [1268568009.608264] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0001 (hid)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0001
SUBSYSTEM=hid
HID_ID=0003:0000046D:0000C00C
HID_NAME=Logitech USB Mouse
HID_PHYS=usb-0000:00:1d.1-2/input0
MODALIAS=hid:b0003v0000046Dp0000C00C
SEQNUM=48171
UDEV [1268568009.609657] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14 (input)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input14
SUBSYSTEM=input
PRODUCT=3/46d/c00c/110
NAME="Logitech USB Mouse"
PHYS="usb-0000:00:1d.1-2/input0"
UNIQ=""
EV==17
KEY==70000 0 0 0 0
REL==103
MSC==10
MODALIAS=input:b0003v046DpC00Ce0110-e0,1,2,4,k110,111,112,r0,1,8,am4,lsfw
SEQNUM=48169
UDEV [1268568009.611650] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0 (usb)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0
SUBSYSTEM=usb
DEVTYPE=usb_interface
DEVICE=/proc/bus/usb/007/002
PRODUCT=46d/c00c/610
TYPE=0/0/0
INTERFACE=3/1/2
MODALIAS=usb:v046DpC00Cd0610dc00dsc00dp00ic03isc01ip02
SEQNUM=48172
UDEV [1268568009.614119] remove /devices/pci0000:00/0000:00:1d.1/usb7/7-2 (usb)
UDEV_LOG=0
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/007/002
DEVTYPE=usb_device
DEVICE=/proc/bus/usb/007/002
PRODUCT=46d/c00c/610
TYPE=0/0/0
BUSNUM=007
DEVNUM=002
SEQNUM=48173
ID_VENDOR=Logitech
ID_VENDOR_ENC=Logitech
ID_VENDOR_ID=046d
ID_MODEL=USB_Mouse
ID_MODEL_ENC=USB\x20Mouse
ID_MODEL_ID=c00c
ID_REVISION=0610
ID_SERIAL=Logitech_USB_Mouse
ID_BUS=usb
ID_USB_INTERFACES=:030102:
MAJOR=189
MINOR=769
DEVLINKS=/dev/char/189:769
KERNEL[1268568012.396622] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2 (usb)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2
SUBSYSTEM=usb
DEVNAME=bus/usb/007/003
DEVTYPE=usb_device
DEVICE=/proc/bus/usb/007/003
PRODUCT=46d/c00c/610
TYPE=0/0/0
BUSNUM=007
DEVNUM=003
SEQNUM=48174
MAJOR=189
MINOR=770
KERNEL[1268568012.399460] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0 (usb)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0
SUBSYSTEM=usb
DEVTYPE=usb_interface
DEVICE=/proc/bus/usb/007/003
PRODUCT=46d/c00c/610
TYPE=0/0/0
INTERFACE=3/1/2
MODALIAS=usb:v046DpC00Cd0610dc00dsc00dp00ic03isc01ip02
SEQNUM=48175
KERNEL[1268568012.399649] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0002 (hid)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0002
SUBSYSTEM=hid
HID_ID=0003:0000046D:0000C00C
HID_NAME=Logitech USB Mouse
HID_PHYS=usb-0000:00:1d.1-2/input0
DRIVER=generic-usb
MODALIAS=hid:b0003v0000046Dp0000C00C
SEQNUM=48176
KERNEL[1268568012.415310] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16 (input)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16
SUBSYSTEM=input
PRODUCT=3/46d/c00c/110
NAME="Logitech USB Mouse"
PHYS="usb-0000:00:1d.1-2/input0"
UNIQ=""
EV==17
KEY==70000 0 0 0 0
REL==103
MSC==10
MODALIAS=input:b0003v046DpC00Ce0110-e0,1,2,4,k110,111,112,r0,1,8,am4,lsfw
SEQNUM=48177
KERNEL[1268568012.415530] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16/mouse2 (input)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16/mouse2
SUBSYSTEM=input
DEVNAME=input/mouse2
SEQNUM=48178
MAJOR=13
MINOR=34
KERNEL[1268568012.415645] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16/event14 (input)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16/event14
SUBSYSTEM=input
DEVNAME=input/event14
SEQNUM=48179
MAJOR=13
MINOR=78
KERNEL[1268568012.415763] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0002/hidraw/hidraw0 (hidraw)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0002/hidraw/hidraw0
SUBSYSTEM=hidraw
DEVNAME=hidraw0
SEQNUM=48180
MAJOR=251
MINOR=0
UDEV [1268568012.419223] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2 (usb)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/007/003
DEVTYPE=usb_device
DEVICE=/proc/bus/usb/007/003
PRODUCT=46d/c00c/610
TYPE=0/0/0
BUSNUM=007
DEVNUM=003
SEQNUM=48174
ID_VENDOR=Logitech
ID_VENDOR_ENC=Logitech
ID_VENDOR_ID=046d
ID_MODEL=USB_Mouse
ID_MODEL_ENC=USB\x20Mouse
ID_MODEL_ID=c00c
ID_REVISION=0610
ID_SERIAL=Logitech_USB_Mouse
ID_BUS=usb
ID_USB_INTERFACES=:030102:
MAJOR=189
MINOR=770
DEVLINKS=/dev/char/189:770
UDEV [1268568012.420120] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0 (usb)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0
SUBSYSTEM=usb
DEVTYPE=usb_interface
DEVICE=/proc/bus/usb/007/003
PRODUCT=46d/c00c/610
TYPE=0/0/0
INTERFACE=3/1/2
MODALIAS=usb:v046DpC00Cd0610dc00dsc00dp00ic03isc01ip02
SEQNUM=48175
UDEV [1268568012.420621] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0002 (hid)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0002
SUBSYSTEM=hid
HID_ID=0003:0000046D:0000C00C
HID_NAME=Logitech USB Mouse
HID_PHYS=usb-0000:00:1d.1-2/input0
DRIVER=generic-usb
MODALIAS=hid:b0003v0000046Dp0000C00C
SEQNUM=48176
UDEV [1268568012.421369] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0002/hidraw/hidraw0 (hidraw)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/0003:046D:C00C.0002/hidraw/hidraw0
SUBSYSTEM=hidraw
DEVNAME=/dev/hidraw0
SEQNUM=48180
MAJOR=251
MINOR=0
DEVLINKS=/dev/char/251:0
UDEV [1268568012.453075] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16 (input)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16
SUBSYSTEM=input
PRODUCT=3/46d/c00c/110
NAME="Logitech USB Mouse"
PHYS="usb-0000:00:1d.1-2/input0"
UNIQ=""
EV==17
KEY==70000 0 0 0 0
REL==103
MSC==10
MODALIAS=input:b0003v046DpC00Ce0110-e0,1,2,4,k110,111,112,r0,1,8,am4,lsfw
SEQNUM=48177
UDEV [1268568012.457340] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16/mouse2 (input)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16/mouse2
SUBSYSTEM=input
DEVNAME=/dev/input/mouse2
SEQNUM=48178
ID_INPUT=1
ID_INPUT_MOUSE=1
ID_VENDOR=Logitech
ID_VENDOR_ENC=Logitech
ID_VENDOR_ID=046d
ID_MODEL=USB_Mouse
ID_MODEL_ENC=USB\x20Mouse
ID_MODEL_ID=c00c
ID_REVISION=0610
ID_SERIAL=Logitech_USB_Mouse
ID_TYPE=hid
ID_BUS=usb
ID_USB_INTERFACES=:030102:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=usbhid
ID_PATH=pci-0000:00:1d.1-usb-0:2:1.0
MAJOR=13
MINOR=34
DEVLINKS=/dev/char/13:34 /dev/input/by-id/usb-Logitech_USB_Mouse-mouse /dev/input/by-path/pci-0000:00:1d.1-usb-0:2:1.0-mouse
UDEV [1268568012.457383] add /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16/event14 (input)
UDEV_LOG=0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.0/input/input16/event14
SUBSYSTEM=input
DEVNAME=/dev/input/event14
SEQNUM=48179
ID_INPUT=1
ID_INPUT_MOUSE=1
ID_VENDOR=Logitech
ID_VENDOR_ENC=Logitech
ID_VENDOR_ID=046d
ID_MODEL=USB_Mouse
ID_MODEL_ENC=USB\x20Mouse
ID_MODEL_ID=c00c
ID_REVISION=0610
ID_SERIAL=Logitech_USB_Mouse
ID_TYPE=hid
ID_BUS=usb
ID_USB_INTERFACES=:030102:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=usbhid
ID_PATH=pci-0000:00:1d.1-usb-0:2:1.0
MAJOR=13
MINOR=78
DEVLINKS=/dev/char/13:78 /dev/input/by-id/usb-Logitech_USB_Mouse-event-mouse /dev/input/by-path/pci-0000:00:1d.1-usb-0:2:1.0-event-mouse
Thank you. -
[SOLVED]system fails to boot since adding udev rules for automounting
Hello
I have recently been trying to use udev rules to automount, and putting together stuff from the wiki, forums and general googling around have produced the following set of rules:
# automounts usb hdd and pendrives as usbhd-sdx; no messing around with
# volume labels or other confusing stuff
# matches all sdx devices except the internal hdd, sda
KERNEL=="sd[b-z]", NAME="%k", SYMLINK+="usbhd-%k", GROUP="users", OPTIONS="last_rule"
# imports filesystem information
ACTION=="add", IMPORT{program}="/sbin/blkid -o udev -p %N"
# creates mount points and sets up symlinks
ACTION=="add", KERNEL=="sd[b-z][0-9]", SYMLINK+="usbhd-%k", GROUP="users", NAME="%k"
ACTION=="add", KERNEL=="sd[b-z][0-9]", RUN+="/bin/mkdir -p /media/usbhd-%k"
ACTION=="add", KERNEL=="sd[b-z][0-9]", RUN+="/bin/ln -s /media/usbhd-%k /mnt/usbhd-%k"
# global mount options
ACTION=="add", ENV{mount_options}="relatime"
# filesystem-specific mount options (777/666 dir/file perms for ntfs/vfat)
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},gid=100,dmask=000,fmask=111,utf8"
# automount ntfs filesystem with ntfs-3g driver
ACTION=="add", KERNEL=="sd[b-z][0-9]", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/mount -t ntfs-3g -o %E{mount_options} /dev/%k /media/usbhd-%k", OPTIONS="last_r$
# automount all other file systems
ACTION=="add", KERNEL=="sd[b-z][0-9]", ENV{ID_FS_TYPE}!="ntfs", RUN+="/bin/mount -t auto -o %E{mount_options} /dev/%k /media/usbhd-%k", OPTIONS="last_rule"
# unmounts and removes the mount points
ACTION=="remove", KERNEL=="sd[b-z][0-9]", RUN+="/bin/rm -f /mnt/usbhd-%k"
ACTION=="remove", KERNEL=="sd[b-z][0-9]", RUN+="/bin/umount -l /media/usbhd-%k"
ACTION=="remove", KERNEL=="sd[b-z][0-9]", RUN+="/bin/rmdir /media/usbhd-%k", OPTIONS="last_rule"
This seemed to be working very well unitl I tried to boot this morning and the boot process stopped at "processing UDev events" with the following message:
iTCO_wdt: Unexpected close, not stopping watchdog!
It pauses at this point for 10-15 seconds and then reboots.
Having searched a bit, I found the following similar post on the forums: http://bbs.archlinux.org/viewtopic.php?pid=459375
Which suggests that the problem might lie with this line:
ACTION=="add", IMPORT{program}="/sbin/blkid -o udev -p %N"
I have renamed the file so that it no longer has the udev .rules extension and now the system boots fine. Does anyone have any suggestions as to why the above rules might be causing this behaviour and how I might go about fixing it?
Thanks
Last edited by useradded (2010-07-02 22:58:14)Hey falconindy
That was the final kick up the logical a$$ that I needed to get some kind of grip on udev rules. I now have a fully functional rule that applies only to /dev/sdxy and not to everything else as well, so no more boot trauma, THANK YOU.
I will mark this thread as solved and post my new rule for the benefit of anyone who might read this.
New rule (no boot problems):
# automounts usb hdd and pendrives as label or as usbhd-sdxy if no label present
# ensures the following is _only_ run for sdxy devices excluding internal hdd, sda
KERNEL!="sd[b-z][0-9]", GOTO="personal_usb_automount_settings_end"
# imports filesystem information
# provides access to following variables:
# ID_FS_UUID; ID_FS_UUID_ENC; ID_FS_VERSION; ID_FS_TYPE; ID_FS_VERSION; ID_FS_LABEL
# accessible via ENV{variable}; $env{variable}|%E{variable}
IMPORT{program}="/sbin/blkid -o udev -p %N"
# Get a label if present, otherwise name usbhd-%k
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"
# creates mount points and sets up symlinks
ACTION=="add", SYMLINK+="%E{dir_name}", GROUP="users", NAME="%k"
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}"
ACTION=="add", RUN+="/bin/ln -s /media/%E{dir_name} /mnt/%E{dir_name}"
# global mount options
ACTION=="add", ENV{mount_options}="relatime"
# filesystem-specific mount options (777/666 dir/file perms for ntfs/vfat)
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},gid=100,dmask=000,fmask=111,utf8"
# automount ntfs filesystem with ntfs-3g driver
ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/mount -t ntfs-3g -o %E{mount_options} /dev/%k /media/%E{dir_name}", OPTIONS="last_rule"
# automount all other file systems
ACTION=="add",ENV{ID_FS_TYPE}!="ntfs", RUN+="/bin/mount -t auto -o %E{mount_options} /dev/%k /media/%E{dir_name}", OPTIONS="last_rule"
# unmounts and removes the mount points
ACTION=="remove", RUN+="/bin/rm -f /mnt/%E{dir_name}"
ACTION=="remove", RUN+="/bin/umount -l /media/%E{dir_name}"
ACTION=="remove", RUN+="/bin/rmdir /media/%E{dir_name}", OPTIONS="last_rule"
# exit
LABEL=="personal_usb_automount_settings_end"
Last edited by useradded (2010-07-02 22:59:20) -
[SOLVED] udev rule no longer working
I have a udev rule set up to automatically mount an ext4 filesystem when I plug a certain thumb drive in. It was working fine until yesterday (probably due to updates). Here is the rule, in file /etc/udev/rules.d/99-gfk.rules:
KERNEL=="sd?2", SUBSYSTEM=="block", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="6545", ATTRS{serial}=="1C6F654E4041ED601910053F", SYMLINK+="gfshare"
ACTION=="add", KERNEL=="sd?2", SUBSYSTEM=="block", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="6545", ATTRS{serial}=="1C6F654E4041ED601910053F", RUN+="/bin/mkdir /media/gfshare"
ACTION=="add", KERNEL=="sd?2", SUBSYSTEM=="block", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="6545", ATTRS{serial}=="1C6F654E4041ED601910053F", RUN+="/bin/mount -t ext4 -o ro,nosuid,nodev,noexec,noatime /dev/gfshare /media/gfshare"
The symlink and the mkdir command are both working fine, but the mount command is not being run for some reason. If I manually run the mount command it works fine. Some possibly helpful output:
# pacman -Qo $(which udevadm)
/usr/bin/udevadm is owned by systemd 212-1
# dmesg |tail -16
[26458.120628] usb 7-1.3: new high-speed USB device number 7 using ehci-pci
[26458.223059] usb-storage 7-1.3:1.0: USB Mass Storage device detected
[26458.223825] scsi10 : usb-storage 7-1.3:1.0
[26459.311607] scsi 10:0:0:0: Direct-Access Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 4
[26460.834081] sd 10:0:0:0: [sdd] 15240576 512-byte logical blocks: (7.80 GB/7.26 GiB)
[26460.834931] sd 10:0:0:0: [sdd] Write Protect is off
[26460.834935] sd 10:0:0:0: [sdd] Mode Sense: 23 00 00 00
[26460.835617] sd 10:0:0:0: [sdd] No Caching mode page found
[26460.835621] sd 10:0:0:0: [sdd] Assuming drive cache: write through
[26460.839455] sd 10:0:0:0: [sdd] No Caching mode page found
[26460.839460] sd 10:0:0:0: [sdd] Assuming drive cache: write through
[26460.860579] sdd: sdd1 sdd2
[26460.867111] sd 10:0:0:0: [sdd] No Caching mode page found
[26460.867115] sd 10:0:0:0: [sdd] Assuming drive cache: write through
[26460.867118] sd 10:0:0:0: [sdd] Attached SCSI removable disk
[26461.041982] EXT4-fs (sdd2): mounted filesystem with ordered data mode. Opts: (null)
# udevadm test /sys/bus/usb/devices/7-1.3
calling: test
version 212
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
load module index
timestamp of '/etc/systemd/network' changed
timestamp of '/usr/lib/systemd/network' changed
Parsed configuration file /usr/lib/systemd/network/99-default.link
Created link configuration context
timestamp of '/etc/udev/rules.d' changed
Skipping overridden file: /usr/lib/udev/rules.d/80-net-setup-link.rules.
read rules file: /usr/lib/udev/rules.d/10-dm.rules
read rules file: /usr/lib/udev/rules.d/11-dm-lvm.rules
read rules file: /etc/udev/rules.d/12-android.rules
read rules file: /usr/lib/udev/rules.d/13-dm-disk.rules
read rules file: /usr/lib/udev/rules.d/40-hpet-permissions.rules
read rules file: /usr/lib/udev/rules.d/40-usb-media-players.rules
read rules file: /usr/lib/udev/rules.d/42-usb-hid-pm.rules
read rules file: /usr/lib/udev/rules.d/50-firmware.rules
read rules file: /usr/lib/udev/rules.d/50-udev-default.rules
read rules file: /usr/lib/udev/rules.d/51-android.rules
read rules file: /usr/lib/udev/rules.d/60-cdrom_id.rules
read rules file: /usr/lib/udev/rules.d/60-drm.rules
read rules file: /usr/lib/udev/rules.d/60-keyboard.rules
read rules file: /usr/lib/udev/rules.d/60-pcmcia.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-alsa.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-input.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-serial.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-storage-tape.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
read rules file: /usr/lib/udev/rules.d/60-vboxdrv.rules
read rules file: /usr/lib/udev/rules.d/61-accelerometer.rules
read rules file: /usr/lib/udev/rules.d/63-md-raid-arrays.rules
read rules file: /usr/lib/udev/rules.d/64-btrfs.rules
read rules file: /usr/lib/udev/rules.d/64-md-raid-assembly.rules
read rules file: /usr/lib/udev/rules.d/69-cd-sensors.rules
read rules file: /usr/lib/udev/rules.d/69-dm-lvm-metad.rules
read rules file: /usr/lib/udev/rules.d/69-libmtp.rules
read rules file: /usr/lib/udev/rules.d/70-infrared.rules
read rules file: /usr/lib/udev/rules.d/70-power-switch.rules
read rules file: /usr/lib/udev/rules.d/70-uaccess.rules
read rules file: /usr/lib/udev/rules.d/71-seat.rules
read rules file: /usr/lib/udev/rules.d/73-seat-late.rules
read rules file: /usr/lib/udev/rules.d/75-net-description.rules
read rules file: /usr/lib/udev/rules.d/75-probe_mtd.rules
read rules file: /usr/lib/udev/rules.d/75-tty-description.rules
read rules file: /usr/lib/udev/rules.d/78-sound-card.rules
read rules file: /usr/lib/udev/rules.d/80-drivers.rules
read rules file: /etc/udev/rules.d/80-net-setup-link.rules
read rules file: /usr/lib/udev/rules.d/80-udisks.rules
read rules file: /usr/lib/udev/rules.d/80-udisks2.rules
read rules file: /usr/lib/udev/rules.d/85-usbmuxd.rules
read rules file: /usr/lib/udev/rules.d/90-alsa-restore.rules
read rules file: /usr/lib/udev/rules.d/95-cd-devices.rules
read rules file: /usr/lib/udev/rules.d/95-dm-notify.rules
read rules file: /usr/lib/udev/rules.d/95-udev-late.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-dell.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-fujitsu.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-gateway.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-ibm.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-lenovo.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-toshiba.rules
read rules file: /usr/lib/udev/rules.d/95-upower-csr.rules
read rules file: /usr/lib/udev/rules.d/95-upower-hid.rules
read rules file: /usr/lib/udev/rules.d/95-upower-wup.rules
read rules file: /etc/udev/rules.d/99-gfk.rules
read rules file: /usr/lib/udev/rules.d/99-systemd.rules
read rules file: /usr/lib/udev/rules.d/kino.rules
rules contain 98304 bytes tokens (8192 * 12 bytes), 22360 bytes strings
10092 strings (88570 bytes), 8317 de-duplicated (67986 bytes), 1776 trie nodes used
IMPORT builtin 'usb_id' /usr/lib/udev/rules.d/50-udev-default.rules:9
IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/50-udev-default.rules:9
MODE 0664 /usr/lib/udev/rules.d/50-udev-default.rules:37
GROUP 1002 /usr/lib/udev/rules.d/51-android.rules:387
MODE 0660 /usr/lib/udev/rules.d/51-android.rules:387
RUN '/usr/share/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} vboxusers' /usr/lib/udev/rules.d/60-vboxdrv.rules:6
PROGRAM '/usr/lib/udev/mtp-probe /sys/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3 7 7' /usr/lib/udev/rules.d/69-libmtp.rules:1204
starting '/usr/lib/udev/mtp-probe /sys/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3 7 7'
'/usr/lib/udev/mtp-probe /sys/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3 7 7'(out) '0'
'/usr/lib/udev/mtp-probe /sys/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3 7 7' [24644] exit with return code 0
IMPORT builtin 'path_id' /usr/lib/udev/rules.d/71-seat.rules:43
RUN 'uaccess' /usr/lib/udev/rules.d/73-seat-late.rules:15
handling device node '/dev/bus/usb/007/007', devnum=c189:774, mode=0660, uid=0, gid=1002
preserve permissions /dev/bus/usb/007/007, 020660, uid=0, gid=1002
preserve already existing symlink '/dev/char/189:774' to '../bus/usb/007/007'
ACTION=add
BUSNUM=007
DEVNAME=/dev/bus/usb/007/007
DEVNUM=007
DEVPATH=/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_DRIVE_THUMB=1
ID_FOR_SEAT=usb-pci-0000_00_1a_7-usb-0_1_3
ID_MODEL=DataTraveler_2.0
ID_MODEL_ENC=DataTraveler\x202.0
ID_MODEL_FROM_DATABASE=Kingston DataTraveler 102 Flash Drive / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick
ID_MODEL_ID=6545
ID_PATH=pci-0000:00:1a.7-usb-0:1.3
ID_PATH_TAG=pci-0000_00_1a_7-usb-0_1_3
ID_REVISION=0100
ID_SERIAL=Kingston_DataTraveler_2.0_1C6F654E4041ED601910053F
ID_SERIAL_SHORT=1C6F654E4041ED601910053F
ID_USB_INTERFACES=:080650:
ID_VENDOR=Kingston
ID_VENDOR_ENC=Kingston
ID_VENDOR_FROM_DATABASE=Toshiba Corp.
ID_VENDOR_ID=0930
MAJOR=189
MINOR=774
PRODUCT=930/6545/100
SUBSYSTEM=usb
TAGS=:seat:uaccess:
TYPE=0/0/0
USEC_INITIALIZED=26452326568
adb_user=yes
run: '/usr/share/virtualbox/VBoxCreateUSBNode.sh 189 774 00 vboxusers'
run: 'uaccess'
unload module index
Unloaded link configuration context
# udevadm test /sys/bus/usb/devices/7-1.3:1.0
calling: test
version 212
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
load module index
timestamp of '/etc/systemd/network' changed
timestamp of '/usr/lib/systemd/network' changed
Parsed configuration file /usr/lib/systemd/network/99-default.link
Created link configuration context
timestamp of '/etc/udev/rules.d' changed
Skipping overridden file: /usr/lib/udev/rules.d/80-net-setup-link.rules.
read rules file: /usr/lib/udev/rules.d/10-dm.rules
read rules file: /usr/lib/udev/rules.d/11-dm-lvm.rules
read rules file: /etc/udev/rules.d/12-android.rules
read rules file: /usr/lib/udev/rules.d/13-dm-disk.rules
read rules file: /usr/lib/udev/rules.d/40-hpet-permissions.rules
read rules file: /usr/lib/udev/rules.d/40-usb-media-players.rules
read rules file: /usr/lib/udev/rules.d/42-usb-hid-pm.rules
read rules file: /usr/lib/udev/rules.d/50-firmware.rules
read rules file: /usr/lib/udev/rules.d/50-udev-default.rules
read rules file: /usr/lib/udev/rules.d/51-android.rules
read rules file: /usr/lib/udev/rules.d/60-cdrom_id.rules
read rules file: /usr/lib/udev/rules.d/60-drm.rules
read rules file: /usr/lib/udev/rules.d/60-keyboard.rules
read rules file: /usr/lib/udev/rules.d/60-pcmcia.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-alsa.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-input.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-serial.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-storage-tape.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
read rules file: /usr/lib/udev/rules.d/60-vboxdrv.rules
read rules file: /usr/lib/udev/rules.d/61-accelerometer.rules
read rules file: /usr/lib/udev/rules.d/63-md-raid-arrays.rules
read rules file: /usr/lib/udev/rules.d/64-btrfs.rules
read rules file: /usr/lib/udev/rules.d/64-md-raid-assembly.rules
read rules file: /usr/lib/udev/rules.d/69-cd-sensors.rules
read rules file: /usr/lib/udev/rules.d/69-dm-lvm-metad.rules
read rules file: /usr/lib/udev/rules.d/69-libmtp.rules
read rules file: /usr/lib/udev/rules.d/70-infrared.rules
read rules file: /usr/lib/udev/rules.d/70-power-switch.rules
read rules file: /usr/lib/udev/rules.d/70-uaccess.rules
read rules file: /usr/lib/udev/rules.d/71-seat.rules
read rules file: /usr/lib/udev/rules.d/73-seat-late.rules
read rules file: /usr/lib/udev/rules.d/75-net-description.rules
read rules file: /usr/lib/udev/rules.d/75-probe_mtd.rules
read rules file: /usr/lib/udev/rules.d/75-tty-description.rules
read rules file: /usr/lib/udev/rules.d/78-sound-card.rules
read rules file: /usr/lib/udev/rules.d/80-drivers.rules
read rules file: /etc/udev/rules.d/80-net-setup-link.rules
read rules file: /usr/lib/udev/rules.d/80-udisks.rules
read rules file: /usr/lib/udev/rules.d/80-udisks2.rules
read rules file: /usr/lib/udev/rules.d/85-usbmuxd.rules
read rules file: /usr/lib/udev/rules.d/90-alsa-restore.rules
read rules file: /usr/lib/udev/rules.d/95-cd-devices.rules
read rules file: /usr/lib/udev/rules.d/95-dm-notify.rules
read rules file: /usr/lib/udev/rules.d/95-udev-late.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-dell.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-fujitsu.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-gateway.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-ibm.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-lenovo.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-toshiba.rules
read rules file: /usr/lib/udev/rules.d/95-upower-csr.rules
read rules file: /usr/lib/udev/rules.d/95-upower-hid.rules
read rules file: /usr/lib/udev/rules.d/95-upower-wup.rules
read rules file: /etc/udev/rules.d/99-gfk.rules
read rules file: /usr/lib/udev/rules.d/99-systemd.rules
read rules file: /usr/lib/udev/rules.d/kino.rules
rules contain 98304 bytes tokens (8192 * 12 bytes), 22360 bytes strings
10092 strings (88570 bytes), 8317 de-duplicated (67986 bytes), 1776 trie nodes used
IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/50-udev-default.rules:11
RUN 'kmod load $env{MODALIAS}' /usr/lib/udev/rules.d/80-drivers.rules:5
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3/7-1.3:1.0
DEVTYPE=usb_interface
DRIVER=usb-storage
ID_MODEL_FROM_DATABASE=Kingston DataTraveler 102 Flash Drive / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick
ID_VENDOR_FROM_DATABASE=Toshiba Corp.
INTERFACE=8/6/80
MODALIAS=usb:v0930p6545d0100dc00dsc00dp00ic08isc06ip50in00
PRODUCT=930/6545/100
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=452326811
run: 'kmod load usb:v0930p6545d0100dc00dsc00dp00ic08isc06ip50in00'
unload module index
Unloaded link configuration context
Last edited by bentglasstube (2014-04-03 20:51:36)I see. That is somewhat aggravating but I will find another way to achieve what I wanted I suppose.
Thank you. Should I mark this is solved or unsolvable or something? Sorry, I'm new to posting on these forums.
Edit: I was able to achieve what I wanted with udevil as recommended by the wiki.
Last edited by bentglasstube (2014-04-03 20:55:45) -
Configuring udev rules for Oracle 10g R2 Rac on OEL 5.5 U4 with Qnap
I'm trying to setup a 10g RAC Cluster following the guide by Jeff Hunter on http://www.idevelopment.info/
I have to admit, im no Linux admin, and have searched round the net for help with the following Issue.
I'm trying to set my iSCSI targets to have persistent mappings using udev rules
This is what I have done so far
[root@racnode1 Server]# iscsiadm -m discovery -t sendtargets -p nas-priv | grep 192.168.2.196
192.168.2.196:3260,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote1.c59a2d
192.168.2.196:3260,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra2.c59a2d
192.168.2.196:3260,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata2.c59a2d
192.168.2.196:3260,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote2.c59a2d
192.168.2.196:3260,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs2.c59a2d
192.168.2.196:3260,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs1.c59a2d
192.168.2.196:3260,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata1.c59a2d
192.168.2.196:3260,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote3.c59a2d
192.168.2.196:3260,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra1.c59a2d
-- Manually Log into iSCSI Targets
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote1.c59a2d -p 192.168.2.196 -l
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra2.c59a2d -p 192.168.2.196 -l
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata2.c59a2d -p 192.168.2.196 -l
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote2.c59a2d -p 192.168.2.196 -l
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs2.c59a2d -p 192.168.2.196 -l
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs1.c59a2d -p 192.168.2.196 -l
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata1.c59a2d -p 192.168.2.196 -l
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote3.c59a2d -p 192.168.2.196 -l
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra1.c59a2d -p 192.168.2.196 -l
-- Make iSCSI Targets Automatically Login
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote1.c59a2d -p 192.168.2.196 --op update -n node.startup -v automatic
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra2.c59a2d -p 192.168.2.196 --op update -n node.startup -v automatic
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata2.c59a2d -p 192.168.2.196 --op update -n node.startup -v automatic
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote2.c59a2d -p 192.168.2.196 --op update -n node.startup -v automatic
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs2.c59a2d -p 192.168.2.196 --op update -n node.startup -v automatic
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs1.c59a2d -p 192.168.2.196 --op update -n node.startup -v automatic
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata1.c59a2d -p 192.168.2.196 --op update -n node.startup -v automatic
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote3.c59a2d -p 192.168.2.196 --op update -n node.startup -v automatic
iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra1.c59a2d -p 192.168.2.196 --op update -n node.startup -v automatic
-- Create Persistent Local SCSI Device Names
- Identify Mappings
[root@racnode1 ~]# (cd /dev/disk/by-path; ls -l qnap | awk '{FS=" "; print $9 " " $10 " " $11}')
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs1.c59a2d-lun-0 -> ../../sdg
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs2.c59a2d-lun-0 -> ../../sdf
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata1.c59a2d-lun-0 -> ../../sdi
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata2.c59a2d-lun-0 -> ../../sdd
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra1.c59a2d-lun-0 -> ../../sdj
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra2.c59a2d-lun-0 -> ../../sdc
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote1.c59a2d-lun-0 -> ../../sdb
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote2.c59a2d-lun-0 -> ../../sde
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote3.c59a2d-lun-0 -> ../../sdh
- Create Rules File
cat >> /etc/udev/rules.d/55-openiscsi.rules <<EOF
# /etc/udev/rules.d/55-openiscsi.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"
EOF
- Create Shell Script
mkdir -p /etc/udev/scripts
vi /etc/udev/scripts/iscsidev.sh
#!/bin/sh
# FILE: /etc/udev/scripts/iscsidev.sh
BUS=${1}
HOST=${BUS%%:*}
[ -e /sys/class/iscsi_host ] || exit 1
file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"
target_name=$(cat ${file})
# This is not an open-scsi drive
if [ -z "${target_name}" ]; then
exit 1
fi
# Check if QNAP drive
check_qnap_target_name=${target_name%%:*}
if [ $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then
target_name=`echo "${target_name%.*}"`
fi
echo "${target_name##*.}"
chmod 755 /etc/udev/scripts/iscsidev.sh
service iscsi stop
service iscsi start
[root@racnode1 ~]# ls /dev/iscsi/*
ls: /dev/iscsi/*: No such file or directory
1.) For some reason I cannot get the mappings to work correctly, I have rebooted the server and tried a number of different changes in the rules script. But for the life of me I cannot get it work.
I noticed when I rebooted the server that it failed to execute the iscsidev. When I manually run the shell script with a parameter it produces output
Can anyone help me to get this up and running?
2.) My QNAP Nas doesnt seem to publish iSCSI targets to only one NIC. I think this is down to the firmware/feature not being available. When I discover targets I get the following
[root@racnode1 ~]# (cd /dev/disk/by-path; ls -l *qnap* | awk '{FS=" "; print $9 " " $10 " " $11}')
ip-192.168.1.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs1.c59a2d-lun-0 -> ../../sdh
ip-192.168.1.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs2.c59a2d-lun-0 -> ../../sdm
ip-192.168.1.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata1.c59a2d-lun-0 -> ../../sdn
ip-192.168.1.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata2.c59a2d-lun-0 -> ../../sde
ip-192.168.1.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra1.c59a2d-lun-0 -> ../../sdr
ip-192.168.1.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra2.c59a2d-lun-0 -> ../../sdd
ip-192.168.1.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote1.c59a2d-lun-0 -> ../../sdb
ip-192.168.1.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote2.c59a2d-lun-0 -> ../../sdk
ip-192.168.1.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote3.c59a2d-lun-0 -> ../../sdp
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs1.c59a2d-lun-0 -> ../../sdi
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs2.c59a2d-lun-0 -> ../../sdg
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata1.c59a2d-lun-0 -> ../../sdo
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata2.c59a2d-lun-0 -> ../../sdj
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra1.c59a2d-lun-0 -> ../../sds
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra2.c59a2d-lun-0 -> ../../sdf
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote1.c59a2d-lun-0 -> ../../sdc
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote2.c59a2d-lun-0 -> ../../sdl
ip-192.168.2.196:3260-iscsi-iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote3.c59a2d-lun-0 -> ../../sdq
It shows the same targets on both NIC's, I only need them on the private ip 192.168.2.196
Edited by: user1728822 on 07-May-2011 15:53
Edited by: user1728822 on 07-May-2011 16:08Hi,
I'm facing the same issue.. If your issue is fixed..could you please let me know?
I'm trying to configure 11g RAC with OPenfiler and got stuck here.
Regards,
Kumar -
[Solved] Auto-open a file manager after mounting with udev rules
Hellooooo,
I followed the udev Wiki for auto mounting USBs and it now works great.
The only problem is: how can I automatically open a file manager of the mounted directory? I tried putting this at the end of the "ACTION=="add"," section in "/etc/udev/rules.d/11-media-by-label-auto-mount.rules" but for some reason nothing happens:
, RUN+="/usr/bin/dolphin /media/%E{dir_name}"
Even if I just try to open dolphin with the "ACTION=="add"," section nothing happens either way.
So what am I doing wrong?
Last edited by algorythm (2011-05-05 12:35:56)In that case, the best choice in my opinion is to use Automounting UDisks Wrappers :
devmon is a script developed by IgnorantGuru. He left Arch Linux, but the package in AUR is still there and is the last version. For a future new release, it should be available at his blog site. The script is distro independent.
My udisksvm script, in its default state, doesn't launch a file manager after automounting, but it is not a big thing to let the automounting be done and then manually open a file manager (a new entry in the traydevice right-click menu can also be added for that).
If you can do without automounting, there is also the bashmount script from jnguyen.
All these scripts don't require writing any udev rules, they use udisks instead.
I hope you could find something you like and which will suit your wishes. -
Udev rules and group / permission errors [solved] [outdated]
Latest udev is a miracle to me. It ignores every group ore permission settings. Anyone else having same experiences?
Last edited by Moo-Crumpus (2008-09-29 05:17:40)Let's assume that you have two files with udev rules. The basic udev.rules and 00.udev.rules (with custom rules).
Udev first reads all rules from 00 file and then rules from the basic file.
This means that if you have a custom rule for a given device you should copy all rules that apply to it from the basic file to the 00 file (not only lines with GROUP). This is because with OPTIONS="last_rule" udev will stop processing rules for this device.
All rules are read and then applied in the order from the top to bottom except SUBSYTEM which is applied as the last rule (kind of held in a buffer). This is the reason why my cd burner /dev/hdc had permissions for disk group and not optical.
This is my 00.udev.rules (it still needs some cosmetic changes but it works and of course I don't have all the devices):
SUBSYSTEM="video4linux", GROUP="users"
SUBSYSTEM="sound", GROUP="users"
SUBSYSTEM="printer", GROUP="users"
SUBSYSTEM="block", GROUP="disk"
BUS="ide", KERNEL="hd[a-z]", PROGRAM="/etc/udev/cdsymlinks.sh %k", SYMLINK="%c{1} %c{2} %c{3} %c{4} %c{5} %c{6}"
BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", SYMLINK="%c{1} %c{2}"
BUS="ide", KERNEL="hdc", SYSFS{removable}="1", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom*", NAME="%k", GROUP="users", SYMLINK="nagrywarka dvd cdrw", OPTIONS="last_rule"
BUS="ide", KERNEL="hd[a-z]", SYSFS{removable}="1", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom*", NAME="%k", GROUP="users", OPTIONS="last_rule"
BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-floppy.sh %k", RESULT="floppy", NAME{all_partitions}="%k", GROUP="users", OPTIONS="last_rule"
BUS="scsi", KERNEL="sr[0-9]*", PROGRAM="/etc/udev/cdsymlinks.sh %k", SYMLINK="%c{1} %c{2} %c{3} %c{4} %c{5} %c{6}"
BUS="scsi", KERNEL="scd[0-9]*", PROGRAM="/etc/udev/cdsymlinks.sh %k", SYMLINK="%c{1} %c{2} %c{3} %c{4} %c{5} %c{6}"
BUS="scsi", KERNEL="sr[0-9]*", SYSFS{type}="5", NAME="scd%n", GROUP="users", OPTIONS="last_rule"
BUS="scsi", KERNEL="sg[0-9]*", SYSFS{type}="5", NAME="%k", GROUP="users", OPTIONS="last_rule"
KERNEL="fd[0-9]*", NAME="fd%n", GROUP="users", SYMLINK="floppy/%n fd%nu1440 fd%nu720 fd%nh1200 fd%nu360", OPTIONS="last_rule"
BUS="usb", SYSFS{serial}="CN16J1Q3HWSX", KERNEL="lp[0-9]*", NAME="usb/%k", GROUP="users", SYMLINK="drukarka_hp_845c drukarka", OPTIONS="last_rule"
BUS="usb", KERNEL="sd*", PROGRAM="/etc/udev/usb-storage.sh %k", RESULT="1", NAME="%k", GROUP="users", OPTIONS="last_rule"
KERNEL="rtc", NAME="misc/%k", SYMLINK="%k", GROUP="users", MODE="0664", OPTIONS="last_rule"
KERNEL="agpgart", NAME="misc/%k", SYMLINK="%k" GROUP="users", OPTIONS="last_rule"
KERNEL="nvidia*", GROUP="users", OPTIONS="last_rule"
KERNEL="fb[0-9]*", NAME="fb/%n", GROUP="users", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="card[0-9]*", NAME="dri/%k", GROUP="users", OPTIONS="last_rule"
KERNEL="3dfx*", NAME="%k", GROUP="users", OPTIONS="last_rule"
KERNEL="dvb*", PROGRAM="/etc/udev/dvb.sh %k", NAME="%c", GROUP="users", OPTIONS="last_rule"
KERNEL="video[0-9]*", NAME="v4l/video%n", GROUP="users", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="radio[0-9]*", NAME="v4l/radio%n", GROUP="users", SYMLINK="radio%e", OPTIONS="last_rule"
KERNEL="vbi[0-9]*", NAME="v4l/vbi%n", GROUP="users", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="vtx[0-9]*", NAME="v4l/vtx%n", GROUP="users", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="controlC[0-9]*", NAME="snd/%k", OPTIONS="last_rule"
KERNEL="hw[CD0-9]*", NAME="snd/%k", OPTIONS="last_rule"
KERNEL="pcm[CD0-9cp]*", NAME="snd/%k", OPTIONS="last_rule"
KERNEL="midi[CD0-9]*", NAME="snd/%k", OPTIONS="last_rule"
KERNEL="timer", NAME="snd/%k", OPTIONS="last_rule"
KERNEL="seq", NAME="snd/%k", OPTIONS="last_rule"
KERNEL="audio*", NAME="sound/%k", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="dmmidi*", NAME="sound/%k", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="admmidi*", NAME="sound/%k", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="dsp*", NAME="sound/%k", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="adsp*", NAME="sound/%k", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="midi*", NAME="sound/%k", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="amidi*", NAME="sound/%k", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="mixer*", NAME="sound/%k", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="sequencer*", NAME="sound/%k", SYMLINK="%k", OPTIONS="last_rule"
KERNEL="pktcdvd", NAME="pktcdvd/control", GROUP="users", MODE="0660", OPTIONS="last_rule"
KERNEL="pktcdvd[0-9]*", NAME="pktcdvd/pktcdvd%n", GROUP="users", MODE="0660", OPTIONS="last_rule"
The problem with /dev/hdc was that first udev (version 057) was reading a rule from my 00 file (BUS="ide", KERNEL="hdc"...) with GROUP=users. Then it was reading SUBSYSTEM="block", GROUP="disk" rule from the basic file (but it wasn't executed at that time). And then it was reading BUS="ide", KERNEL="hd[a-z]", SYSFS{removable}="1"... with GROUP=optical. Then it was executing SUBSYTEM rule (hdc is a block device). That's why only disk group had an access to /dev/hdc (with OPTIONS="last_rule" in the basic file in the GROUP="optical" line it would ignore SUBSYSTEM rule).
There are also other rules that you should add (IMO) to your custom rules if you are changing something. In my case it's for example BUS="ide", KERNEL="hd[a-z]", PROGRAM="/etc/udev/cdsymlinks.sh %k"... which creates symlinks for cd drives. This rule must be above other rules (the number of the symlinks is now unlimited - previously it was 5 IIRC).
So now the rules are mixed together in the lexical order (except SUBSYTEM rules which are executed at the end) unless OPTIONS="last_rule" is used or second (and other) rule has a NAME filed (only one rule for a given device can have NAME filed. Every other rule for the same device with NAME field is ignored IIRC). It also means you can now split rules for a device into several rules - only one of them can have NAME filed and the last should have OPTIONS="last_rule".
Since in your case you have custom rules only for a well defined usb devices (not /dev/sd*) IMO it should work as you think (only add OPTIONS="last_rule").
I hope it's now perfectly clear 8) -
Hi !
A few days ago I did a pacman -ySu but I ran into some problems.
After updating xorg and catalyst graphic drivers my X was "broken" (xinerama/xrandr related issues). So before I did a 'pacman -ySu' I saved my local database with 'yaourt -B backup.tar.bz2', after trying to get X to work I decided to resotre the backup. To make it short, I think I completly messed up pacman. So after that I redid a 'pacman -ySu', but it was annoying me with the 'file exist' thing, so I did 'pacman -ySuf' which overwrited existing files. And I ended up with some "hidden" issues, like the 'core/dbus' package being installed (according to pacman), but files like '/usr/lib/libdbus-1.so' where missing (I had that for few packages, but since it only appers when I'm actually using theses packages, there might be a lot more to come). Reinstalling thses packages solves this problem.
So that was the context, in the case my problem could be related to this.
The problem is, I'm using AutoFS and udev to auto-mount my usb keys and external hard drive.
Udev creates a special node in '/dev/' (e,g, for my usb key it creates '/dev/usbstick') and AutoFS then automatically mounts /dev/usbstick to /media/key.
It used to work perfectly but after that upgrade (I also installed hal and acpid in the meantime), it doesn't seem to work. The node '/dev/usbstick' doesn't get created.
Here is the rule I'm using to do so:
/etc/udev/rules.d/07-key.rules
$>cat /etc/udev/rules.d/07-key.rules
ATTRS{product}=="Flash Drive", KERNEL=="sd?[1-9]", NAME="%k", SYMLINK+="usbstick", GROUP="storage"
ATTRS{product}=="USB Flash Memory", KERNEL=="sd?[1-9]", NAME="%k", SYMLINK+="usbstick", GROUP="storage"
So with this only, udev is supposed to create a node in '/dev/usbstick' right ?
But 'ls /dev/ | grep usbstick' returns nothing.
Udev is running correctly:
$> ps aux | grep udevd
root 818 0.0 0.0 1852 716 ? S<s 16:26 0:00 /sbin/udevd --daemon
Here is dmesg's output:
$>dmesg
usb 4-1: new high speed USB device using ehci_hcd and address 16
usb 4-1: configuration #1 chosen from 1 choice
scsi20 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 16
usb-storage: waiting for device to settle before scanning
scsi 20:0:0:0: Direct-Access USB Flash Memory 1.00 PQ: 0 ANSI: 2
sd 20:0:0:0: [sdd] 3953664 512-byte hardware sectors (2024 MB)
sd 20:0:0:0: [sdd] Write Protect is off
sd 20:0:0:0: [sdd] Mode Sense: 0b 00 00 08
sd 20:0:0:0: [sdd] Assuming drive cache: write through
sd 20:0:0:0: [sdd] 3953664 512-byte hardware sectors (2024 MB)
sd 20:0:0:0: [sdd] Write Protect is off
sd 20:0:0:0: [sdd] Mode Sense: 0b 00 00 08
sd 20:0:0:0: [sdd] Assuming drive cache: write through
sdd: sdd1
sd 20:0:0:0: [sdd] Attached SCSI removable disk
sd 20:0:0:0: Attached scsi generic sg4 type 0
usb-storage: device scan complete
And udevadm info's output:
$>udevadm info -a -p `udevadm info -q path -n /dev/sdd` | grep ATTRS{product}
ATTRS{product}=="USB Flash Memory"
ATTRS{product}=="EHCI Host Controller"
Thanks!
Last edited by arsenist (2008-12-14 19:30:26)Could this be a bug?
The issue persists in kernel26-2.6.32.4-1 and I don't know if I should report it as a bug. -
Udev rules or buggy hardware driver?
hello out there,
here's my situation, after setting this rule for my graphics tablet...
KERNEL=="event*", SYSFS{manufacturer}="AIPTEK International Inc.",
NAME="input/aiptektablet", MODE="0644"
i revieve the following on next boot...
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt and you might try running e2fsck with an alternate superblock
E2fsck -b 8193 <device>
after removing the rule and rebooting the drive check goes fine and everything runs smooth again.
note:The idea to remove the aiptek udev rule came when I noticed all udev events in /dev/disk/* pointed to the aiptek tablet instead of their usual sda sdb sdc sdd hda1 hda2 etc.
I would still like a consistent input point for my tablet someday, but this situation seems over my head.
any ideas?
thanksThanks for your answer Rexilion.
The author of the module, and the rule, suggest to put the rule in /etc/udev/rules.d under the file name 90-logitech-g710-plus.rules. So that is what I have tried up to now, along with putting the file in /usr/lib/udev/rules.d and changing the preceding number to 10 instead of 90. The only thing that my tinkering has done is that changing ACTION=="add" to ACTION=="add|change" has allowed udevadm trigger to apply the rule. Of course, I could use that to generate some real ugly workaround, but I would rather not. Otherwise, from what I have seen, you are probably right about a race condition, but I have been in the dark as to how to resolve it.
At this point, I have put the rule in /usr/lib/udev/rules.d and used "mkinitcpio -p linux" to rebuild the image, but it doesn't make a difference as to what default rules are in the image. In mkinitcpio.conf, I have the udev hook, but I figure that is kind of defautl, am I to modify that hook? What am I missing? I have read and reread the wiki about udev, and mkinitcpio, but I'm very unclear as to how to add the rule for the keyboard to the default set.
@jasonwryan: Perhaps I'm being stupid, but is loading a module and binding it to the keyboard considered a long running process? I would have thought it is an event which is very short and needs no further attention or resources once it is done. -
[SOLVED] udev rules for U2F FIDO Plug-up key
I just received a cheap U2F FIDO key (http://www.amazon.com/Plug-up-Internati … 00OGPO3ZS/) but couldn't use it under Chrome 38. I had to add the following rule to /etc/udev/rules.d/45-u2f.rules
SUBSYSTEM=="hidraw", MODE="0666", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="f1d0"
and then issued a
# sudo udevadm trigger
Should work with other vendors assuming you change the idVendor and idProduct.
Have fun!LukeHandle wrote:Was thinking about the same device, what are you thoughts on it so far? I was mostly concerned with the price and how that translated to the quality, or lack thereof.
The device for which I sent a link for is cheap one and when you receive it actually looks cheap but does the job. Initially I thought I needed to install the FIDO U2F Chrome extension https://chrome.google.com/webstore/deta … ionmgcdmne but it works just fine without it assuming you are using Chrome or Chromium 38+ and the above udev rule on ArchLinux (not required on Windows and MAC OS).
Use case is fairly limited so far since it can only be used on Google account. I tried to use this Plug-Up U2F dongle on Yubico U2F demo page http://demo.yubico.com/start/u2f/neo but it doesn't work and thus even with the FIDO U2F Chrome extension...Weird since I thought all U2F will all be compatible. Since the protocol is open I hope other use cases will arise such as more major supported websites, easy integration in existing frameworks such as Wordpress, Roundcube... but also alternative uses such as 2nd factor authentication for disk encryption (LUKS). -
sda4 is the partition luks encrypted as home (/dev/home/mapper | /dev/dm-1)
it's opened at boot using /etc/crypttab
ID_FS_LABEL=home in /dev/dm-1
udevadm info /dev/dm-1 --query=all doesn't tell the parent (physical partition sda4). how can I output it so I can use it in udev rule?
or is there any way to match dm-1 with sda4 without hardcoding paths?
I want to write a rule for sda4 but as a condition that it is the parent partition for dm-1 (without hardcoding sda4 and dm-1)
thank you.Sure, a loop that waits up to a certain number of seconds for you to mount the device is far more preferrable. Something like...
#!/bin/bash
# max time to wait
timeout=60
# label of device to wait for
devlabel=blackhole
# where to look for it
devmount=/mnt/backup
dev_mounted() {
mountpoint -q "$devmount" &&
[[ $(findmnt -runo LABEL "$devmount") = "$devlabel" ]]
if ! dev_mounted; then
printf "==> Waiting %s seconds for %s to be mounted on %s" "$devlabel" "$devmount"
until dev_mounted; do
sleep 1
if (( --timeout == 0 )); then
print "==> ERROR: device didn't show up after %s seconds!\n" "$timeout"
exit 1
fi
done
fi
# do backup stuff here... -
Boot image does not exist and cannot read disk label errors.
Hi - I'm having a problem with installing Solaris 9 4/04 on a Netra T1. The Netra already has Solaris 7. I need to get this set up as a jumpstart server but it can't find the boot image. I'm using a brand new bonafide installation disk - not a copy. The system won't let me install/upgrade to Solaris 9 either. I get an error stating that disk label can't be read. I've tried swapping out the CDROM but I still get the same errors. Does anyone know what or why this may be happening? (Oh - and another strange thing - like I said the CDs are the original but there doesn't appear to be a cdrom/cdrom0/s0 directory. The directory I see is cdrom/cdrom0/sol_9_404_sparc/Solaris_9/Tools)
ERROR: Install boot image /cdrom/sol_9_404_sparc/Solaris_9/Tools/Boot does not exist
Check that boot image exists, or use [-t] to
specify a valid boot image elsewhere.
and
Excuting last command: boot cdrom [- nowin]
Boot device: /pci@1f,0/pc1@1/ide/cdrom@2:f file and args: [- nowin]
Can't read disk label.
Can't open disk label package
Evaulating: boot cdrom [- nowin]@1/ide@e/cdrom@2:f File and args: [- nowin]
Can't open boot device
I appreciate any help at all - is there anyone out there who can tell me what I may be doing wrong?
ThanksHi check that you are booting of the right cd. Make sure it is soalris 9 software 1/2 if that fails then it may well be that your cd is buggered. most likely it is buggered it it cant find the boot image.
-
Just coming to grips with some potential media management nightmares and want to find out whether I'm just missing something in the literature. Using Adobe Premiere Pro CC is there any way to modify tape name/reel name/disk label/card number? In both Final Cut Pro and Avid this is pretty straight forward and you can do this on multiple clips, or one at a time. However, I've not seen an easy way of doing this in Premiere.
To be honest, I haven't seen any way of identifying roll/card name within Premiere. It may not be part of everyone's workflow, but it is a rather crucial step for ours, and we're not able to do this at the moment which is pretty frustrating.
Any suggestions would be greatly appreciated. I suppose if we've got to do them one at a time it'll be a nice, quiet afternoon hitting copy and paste for someone!
Thanks in advance.
Amyso strange premiere cant read/import other metadata, after they tout they ready for the big time... you can enter multiple values for some metadata fields, such as tape name. if you highlight multiple clips in the project bin and have metadata panel open, you can then type in your comments/data in the metadata panel, and it will write it to all the highlighted clips. you can also right click the columns in the project bin panel to choose which metadata fields you want, create new metadata fields, and save the setup for other projects...
-
Resized partition using Disk Utility and now Windows 7 will not boot
Hi,
Hopefully someone can help me!!
I had previously used Boot Camp to install Windows 7. However, I later realised I had not given myself anywhere near enough disk space as I started using Windows for things I hadn't originally planned on using it for.
Anyway, long story short, to solve the problem I uninstalled some applications on my Mac OSX and used Disk Utility to decrease the size of my Mac partition. My plan was then to reboot to Windows and use a Windows application to increase the size of the Windows partition. However - I coudln't even get that far.
Upon decreasing the size of my Mac partition (succesfully) I restarted my Mac in order to boot to Windows. However, I was greeted with a message along the lines of "unable to boot to Windows please insert boot disk and press any key" (I can't remember the exact message).
I was wondering if anyone knows of any way to restore my Windows partition, retaining all of my previously saved files on my Windows disk. It's probably a long shot, but the thought of losing everything I have been working on for the last few months is a sickening one.
What does give me a bit of hope is that, if I click Boot Camp it seems to recognise that Windows 7 is installed as the option that appears is to uninstall it.
Furthermore, if I view partitions in Disk Utility, a "DISK0S4" is listed. However, it's only at 20gb - if this WAS my BootCamp partition previously, it was originally at something around 60gb (I think - either way, definitely bigger than 20gb!).
On top of this, my current Macintosh HD parition is at 260gb and with the DISK0S4 partition at 20.21gb, there seems to be some space missing... I'm hoping this is the files I've been working on over the last few months!
Anyway, I've done some searching on the net and it *seems* that GPT fdisk *might* be my savour. I've downloaded it but have no idea how to use it and don't plan on playing about with it as I could no doubt do some real damage. If it is likely to solve my problem however, I'm certainly more than capable of being walked through what I need to do.
Please help!Hi Christopher,
I also have problems with Windows rebooting after partition resize trying to reduce Mac side and increase Windows side. I do not see the BootCamp partition labelled as such while running disk utility. The Windows partition shows up when I boot up while pressing the ALT key. However, when I try to run Windows, it says " error loading operatig system".
I also followed instruction and went through to run gdisk successfully. Results towards the end.
What can be done? Windows still does not boot and It shows ? Suspicious MBR at sector 0.
Below is information based on typical questions you ask.
diskutil list
/dev/disk0 #: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *120.0 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 78.5 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
4: Microsoft Basic Data 31.7 GB disk0s4
sudo gpt -r -vv show disk0
gpt show: disk0: mediasize=120034123776; sectorsize=512; blocks=234441648
gpt show: disk0: Suspicious MBR at sector 0
gpt show: disk0: Pri GPT at sector 1
gpt show: disk0: Sec GPT at sector 234441647
start size index contents
0 1 MBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 153240016 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
153649656 1269544 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
154919200 17628896
172548096 61892608 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
234440704 911
234441615 32 Sec GPT table
234441647 1 Sec GPT header
sudo fdisk /dev/disk0
Disk: /dev/disk0 geometry: 14593/255/63 [234441648 sectors]Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
1: EE 0 0 2 - 1023 254 63 [ 1 - 172548095] <Unknown ID>
*2: 07 1023 254 63 - 1023 254 63 [ 172548096 - 61892608] HPFS/QNX/AUX
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
sudo gdisk /dev/disk0
GPT fdisk (gdisk) version 0.8.7
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Partition table scan:
MBR: hybrid
BSD: not present
APM: not present
GPT: present
Found valid GPT with hybrid MBR; using GPT.
Command (? for help): r
Recovery/transformation command (? for help): h
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 4
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y
Creating entry for GPT partition #4 (MBR partition #2)
Enter an MBR hex code (default 07):
Set the bootable flag? (Y/N): y
Unused partition space(s) found. Use one to protect more partitions? (Y/N): n
Recovery/transformation command (? for help): o
Disk size is 234441648 sectors (111.8 GiB)
MBR disk identifier: "DELETED INFO"
MBR partitions:
Number Boot Start Sector End Sector Status Code
1 1 172548095 primary 0xEE
2 * 172548096 234440703 primary 0x07
Recovery/transformation command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/disk2.
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.
Maybe you are looking for
-
Java error when uninstalling CF11 32-bit
HI all, I am trying to uninstall ColdFusion 11 (32-bit) edition so I can reinstall CF11 64-bit on my Win2k8r2 production server. I currently have CF9 installed and running on this server. I get a fatal error from the jre when attempting the CF11 uni
-
Display No Results Found in APEX page
I have a page with two regions the top region is an html region where users enter query criteria and generate an interactive report in the second region. The second region only displays if there are results from the query in the first region. I wou
-
dear experts, my req is- I have 1 node suppose Address Address- city Hosue No. now based on the value of city I have to map house No with IDOC fields. for example if City = Delhi map House no with E1EDKA1-ADRNR
-
I want to create a page turn effect in Flash, but not just simply that... I want the user to be able to search the text, links to be active... Am I better off just using Flash Paper?
-
B1DE Download problem link is empty
Hello I need B1DE tool for sap 2004 i found link in download section but it failed. SAP Business One Development Environment Setup for SAP Business One SDK 2004 v1.3 Can enyone send mi this instal on my email [email protected] Thanks & Regards. Edit