Page 6 of 9 FirstFirst ... 45678 ... LastLast
Results 51 to 60 of 84

Thread: Create your own udev rules to control removable devices

  1. #51
    Join Date
    Aug 2008
    Beans
    1

    Something different, not mass storage !

    I am attempting to use this guide to create a rule for a symbol barcode scanner. The scanner works perfectly in Linux, becoming a keyboard when it is plugged in... except that is not what I want. I would like the output to go to a file, or a serial port style device.
    I have written a rule in a file named 09-symbol.rules:
    Code:
    ATTRS{idVendor}=="05e0", OPTIONS+="ignore_device"
    I also tried
    Code:
    SYSFS{idVendor}=="05e0", OPTIONS+="ignore_device"
    I then
    Code:
    sudo /etc/init.d/udev restart
    I then disconnect and re-connect the device, which causes this output in /var/messages
    Code:
    Aug 30 02:39:36 inky kernel: [53458.705373] usb 4-1: new full speed USB device using uhci_hcd and address 8
    Aug 30 02:39:37 inky kernel: [53458.911375] usb 4-1: configuration #1 chosen from 1 choice
    Aug 30 02:39:37 inky kernel: [53458.922426] input: ?Symbol Technologies, Inc, 2002 Symbol Bar Code Scanner as /devices/pci0000:00/0000:00:1d.3/usb4/4-1/4-1:1.0/input/input20
    Aug 30 02:39:37 inky kernel: [53458.949614] input,hidraw0: USB HID v1.10 Keyboard [?Symbol Technologies, Inc, 2002 Symbol Bar Code Scanner] on usb-0000:00:1d.3-1
    I intentionally used the "ignore_device" rule, so I would know when I have the rule recognized, and then could work on what I want the rule to do, but as you can see, it is still set-up as an HID keyboard.

    Thanks for your help !
    Last edited by Kevin F; August 30th, 2008 at 08:01 AM.

  2. #52
    Join Date
    Jun 2007
    Beans
    51
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Permissions denied

    Thank you for this guide.
    I'm almost in business, I almost got to the point I'm heading to =) The only problem is when the KDE (I use Kubuntu 8.04) tries to mount new media (I am dealing with a 60 gb external drive), it fails because of lack or permissions.

    Seems like current user have no permissions to mount this media via "KDE Daemon" (a popup thingy that you see when a new media was connected). Dolphin tells me: "Permissions denied".



    I've tried to set uid,gid,umask options in fstab, but, as I've read above, the environment's default volume manager overrides that options, and uses it's own way.
    Code:
    ## external media
    /dev/usbdevices/60gbext /media/60gbext  ntfs-3g locale=ru_RU.UTF-8,umask=000,uid=1000,gid=1000  0       0
    Also tried to set write/read permissions in 10-local.rules:
    Code:
    SUBSYSTEMS=="usb", ATTRS{product}=="USB 2.0  IDE DEVICE    ", KERNEL=="sd?1", NAME="60gbext", SYMLINK="usbdevices/60gbext", MODE="0666", GROUP="areskz"
    Nothing helped =(

    But everything works with
    Code:
    sudo mount -a
    But I don't want to use sudo every time I need to mount a media.

    Any thoughts?

  3. #53
    Join Date
    Jan 2007
    Location
    Ridgeland WI US
    Beans
    464
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Create your own udev rules to control removable devices

    Hi areskz,
    I have camera card readers mounting fine. I posted #33 back up a ways.
    My first thought is simplify some more for the test. Comment out the fstab line and the udev line and boot again. What happens when you plug in the external drive then? Does it mount and put an icon on the desktop? Auto-mount OK? Then try with just the fstab line (no udev rule) and booting again.

    I use gnome not KDE. Gnome normally just puts the new device on the desktop.
    Gigabyte GA-MA790GPT-UD3H - AMD Phenom II x3 720 - 8 GB RAM - 2009 - My first PC from parts!

  4. #54
    Join Date
    Jun 2007
    Beans
    51
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Create your own udev rules to control removable devices

    Hi ridgeland.
    Thank you for your help.
    Without a udev rule, or without a fstab line, or without them both everything is okay — device connects successfully and an icon appears on a desktop. But the trouble is that I need to set locale=ru_RU.UTF-8 to be able to read russian filenames on that drive. Otherwise, if I won't set this option, I will be able to see only english filenames.

    Only a fstab line doesn't make the sense just because the drive has different names every time it is connected.

    Only a udev line is not a choice because I need to set the locale option, as I've said before.

    Just now tried out playing with symlink chmod, but it didn't help.

  5. #55
    Join Date
    Jan 2007
    Location
    Ridgeland WI US
    Beans
    464
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Create your own udev rules to control removable devices

    I think the problem is fstab. Forget udev until fstab works the way you want it.
    I would test options other than:
    locale=ru_RU.UTF-8,umask=000,uid=1000,gid=1000

    My approach is always "baby steps"
    try just
    locale=ru_RU.UTF-8
    and see if that gets the Russian file names even if it is read-only.

    I think the "permission denied" is due to:
    umask=000,uid=1000,gid=1000
    Gigabyte GA-MA790GPT-UD3H - AMD Phenom II x3 720 - 8 GB RAM - 2009 - My first PC from parts!

  6. #56
    Join Date
    Mar 2009
    Beans
    1

    Re: Create your own udev rules to control removable devices

    Hi all:

    I have been trying to get a rule to work for an hidraw device but have been unable to do so. The rule is

    ATTRS{idVendor}=="xxxx", ATTRS{idProduct}="yyyy", MODE="0666"

    (where of course XXXX and YYYY are real VID and PID of the device.)

    When I plug the device into the USB port, two new entries appear in /dev: /dev/hiddev2 and /dev/hidraw3 (the standard HID and raw HID interfaces). The standard HID's file (/dev/hiddev2) gets the 666 permissions (and when I had the group and user name to run under specified, got those as well) but the raw interface (/dev/hidraw3) does not get changed.

    I've tried everything I could think of but can't get this to work. It is the hidraw interface that I need to let the user have access to and hence need the permissions set.

    Any help would be appreciated.

    Thanks, Dave

  7. #57
    Join Date
    Jan 2008
    Location
    British Columbia, CA
    Beans
    34
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Create your own udev rules to control removable devices

    Just following along with Ubuntu 9.04 when I noticed udevinfo was missing, or rather, renamed. I didn't check all the other posts to see if there was a solution, but this worked for me (as root):

    Code:
    ln -s /sbin/udevadm /usr/bin/udevinfo
    To make a link from the new/renamed program to where it used to be, or just call the new program/version directly:

    Code:
    udevadm info -a -p $(udevadm info -q path -n /dev/XXX)
    I also had to do this, instead of 'udevstart', as mentioned in the guide:

    Code:
    sudo /etc/init.d/udev restart
    I hope that saves someone some googling

    EDIT:
    Just finished the rest of the guide, works like a charm! I now have my USB->Serial GPS receiver being attached to /dev/gps. Thanks!
    Last edited by mbrush; September 15th, 2009 at 01:56 AM.

  8. #58
    Join Date
    Dec 2006
    Beans
    58

    Re: Create your own udev rules to control removable devices

    Thank YOU very much! This was extremely helpful!

    By the way, when I added a second entry to 10-local.rules, I didn't even have to restart udev. Just unplugged and replugged the device.
    Last edited by mattydee; September 27th, 2009 at 05:23 AM.

  9. #59
    Join Date
    Oct 2009
    Beans
    1

    Wink Trouble with external USB harddrive (Seagate FreeAgent) [SOLVED]

    Reply for thread:
    http://ubuntuforums.org/showthread.php?t=494673

    I was getting same errors with my
    ST3300601XSRK seagate esata external HDD, on gentoo linux with kernel 2.6.28 and 2.6.30
    I just added in /etc/conf.d/local.start

    echo 1024 > /sys/block/sdb/queue/max_sectors_kb
    echo 1 > /sys/class/scsi_disk/2:0:0:0/allow_restart
    and now everything is back in order. !!!
    Thanks a lot !!!


    Last edited by aggman; October 22nd, 2009 at 12:34 AM. Reason: ooops ... wrong thread ...

  10. #60
    Join Date
    Apr 2006
    Location
    Inkster, MI USA
    Beans
    87
    Distro
    Ubuntu 14.04 Trusty Tahr

    Thumbs down Re: Create your own udev rules to control removable devices

    Excellent job, Sutekh. I have been beating my head against the wall for a long time trying to figure out a solution to this problem. I have several USB devices that are recognized as drives, and trying to figure out which is mounted where is very annoying when a new mount point is written every time you insert the device.

    You might remind everyone that a new udev rule file is required for each device.

    Thanks!
    Tim

Page 6 of 9 FirstFirst ... 45678 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •