Page 3 of 9 FirstFirst 12345 ... LastLast
Results 21 to 30 of 84

Thread: Create your own udev rules to control removable devices

  1. #21
    Join Date
    Apr 2006
    Location
    Chicago
    Beans
    1,406
    Distro
    Ubuntu

    Re: Create your own udev rules to control removable devices

    Nevermind fix with a reboot and fsck
    Last edited by hanzomon4; September 6th, 2006 at 11:45 PM.

  2. #22
    Join Date
    Jan 2006
    Beans
    56

    Re: Create your own udev rules to control removable devices

    I haven't tried this yet, but I'm curious to know if it will work with more than one usb drive. I have four (yes 4, i'm ashamed to say) Cruzer Minis from SanDisk that I use for various things. Following the guide, each needs something unique to identify it so it can be mounted at the same place. But all have Product Name "cruzer mini" and the same product id, etc. so what would I do in this case? Thanks in advance and apologies if this is a dumb question.

  3. #23
    Join Date
    May 2006
    Location
    gippsland
    Beans
    354

    Re: Create your own udev rules to control removable devices

    i dont know about a product ID but i used a model string and mine worked fine on dapper, maybe you could mask the sd?1 part to reflect the various sticks?

    heres my
    Code:
    10-local.rules
    file

    Code:
    BUS=="usb", SYSFS{Model}=="MTM809A2-103  00  Rev: 1.01", KERNEL=="sd?1", NAME="mysonSD", SYMLINK="usbdevices/mysonSD"
    and after a quick
    Code:
    sudo /etc/init.d/udev restart
    i was in buisness.

  4. #24
    Join Date
    Nov 2005
    Beans
    7

    Re: Create your own udev rules to control removable devices

    This is odd. When I used update-manager to upgrade to Edgy, update-manager removed udev. No problem; I reinstalled it. But now none of my udev rules work anymore.

    The permissions and ownership appear to be set correctly:

    Code:
    >ls -l /etc/udev/rules.d/10-local-rules
    -rw-r--r-- 1 root root 202 2006-10-29 16:55 /etc/udev/rules.d/10-local-rules
    And the rules file itself is unchanged from when it did work.

    Code:
    >cat /etc/udev/rules.d/10-local-rules
    BUS="scsi", SYSFS{model}="YP-U1", KERNEL="sd?1", NAME="ipod"
    BUS="scsi", SYSFS{vendor}="Motorola", KERNEL="sd?1", NAME="phone"
    BUS="scsi", SYSFS{model}="PSP", KERNEL="sd?1", NAME="psp"
    Nevertheless, when I plug in my "ipod" (a Samsung knockoff), the device node still gets created at /dev/sda1 and not at /dev/ipod like it's supposed to.

    And yes, I've tried running "/etc/init.d/udev restart". Over and over, in fact.

    Any ideas?
    Last edited by dugan; October 30th, 2006 at 03:08 AM.

  5. #25
    Join Date
    Jun 2005
    Beans
    173

    Re: Create your own udev rules to control removable devices

    Quote Originally Posted by dugan View Post
    Nevertheless, when I plug in my "ipod" (a Samsung knockoff), the device node still gets created at /dev/sda1 and not at /dev/ipod like it's supposed to.
    I'm experiencing the exact same situation. This is the one upgrade issue I haven't figured out.

  6. #26
    Join Date
    Oct 2006
    Beans
    7

    Re: Create your own udev rules to control removable devices

    Quote Originally Posted by berserker View Post
    I'm experiencing the exact same situation. This is the one upgrade issue I haven't figured out.
    I'm also experiencing this.
    Would be nice of somebody had a fix for this...
    I have a LaCie-disk (was /dev/LaCie now is /dev/sda3) that I want mounted at /media/LaCie. But when I double-click it to mount it I get a message saying the mount point could not be established.
    But when I manually create the directory /media/LaCie the disk mounts no problemo... at /media/LaCie-1
    My fix is to make a link from /media/LaCie to /media/LaCie-1

    Now when I restart and double-click on the disk it mounts at /media/LaCie-2. So I remove /media/LaCie and /media/LaCie-1. Won't mount.
    I then do
    Code:
    >sudo ln -s /media/LaCie-1 /media/Lacie
    Still won't mount. So I remove the link and create the directory /media/LaCie and the disk mounts at /media/LaCie-1 again.
    I can then remove /media/LaCie and make the link again.
    Code:
    >sudo ln -s /media/LaCie-1 /media/Lacie
    Now everything works, but it's still annoying.
    Permanent fix would be nice...

  7. #27
    Join Date
    Oct 2006
    Beans
    7

    Re: Create your own udev rules to control removable devices

    Yeay, I've fixed it!
    In the first post it said:
    - The option KERNEL="sd?1" will only match locations like /dev/sda1, /dev/sdb1 and more importantly, it won't match nodes like /dev/sda, /dev/sdb, which can be fdisk'ed. The 'Writing udev rules' guide also mentions this.
    But it should be KERNEL=="sd?1". (it does say so on the line above it)
    Now it works again!

  8. #28
    Join Date
    Nov 2005
    Beans
    7

    Re: Create your own udev rules to control removable devices

    Okay I did it.

    1. renamed my 10-local-rules file to 10-local.rules

    2. smacked self upside the head

    3. Changed the contents of 10-local.rules to:
    Code:
    BUS=="scsi", SYSFS{model}=="YP-U1", KERNEL=="sd?1", NAME="ipod"
    BUS=="scsi", SYSFS{vendor}=="Motorola", KERNEL=="sd?1", NAME="phone"
    BUS=="scsi", SYSFS{model}=="PSP", KERNEL=="sd?1", NAME="psp"

  9. #29
    Join Date
    Jul 2006
    Beans
    4
    Distro
    Ubuntu 6.06 Dapper

    Smile Re: Create your own udev rules to control removable devices

    Hi, just a quick thanks for this guide.

    I have 4 seperate USB devices that I regularly swap in and out and it's been driving me mad that they always appear on the wrong mount point.
    I'd heard udev could be the answer and tonight I decided to look into it.

    It took me around 20 minutes from reading your guide to having it all working perfectly.

    Thanks a lot.

  10. #30
    Join Date
    Aug 2006
    Location
    Toronto, Canada
    Beans
    30
    Distro
    Kubuntu 6.10 Edgy

    Re: Create your own udev rules to control removable devices

    ok, this is a very good howto, and I was struggling like crazy with the same base document you used. No one seemed to know how to do this, and and a howto I was following didn't mention udev rules at all.

    Question: your base document and your howto both talk about devices, but how about lirc? It's not a block device, but a class in the sys tree, so I'm doing my best here, but I'm not at all sure I'm doing it right. At the latest edit, my 10-local.rules file looks like this:

    BUS=="ide", KERNEL=="hdc", MODE="0666", SYMLINK+="cdrom", GROUP="cdrom"
    BUS=="ide", KERNEL=="hdc", MODE="0777", SYMLINK+="cdrw", GROUP="cdrom"
    BUS=="ide", KERNEL=="hdc", MODE="0666", SYMLINK+="dvd", GROUP="cdrom"
    BUS=="ide", KERNEL=="hdc", MODE="0777", SYMLINK+="dvdrw", GROUP="cdrom"
    SUBSYSTEM!="usb_device", ACTION!="add", GOTO="_end"
    # For brother
    SYSFS{idVendor}=="04f9", MODE="666", GROUP="scanner"
    LABEL="_end"
    BUS=="usb", KERNEL=="lirc0", SUBSYSTEM=="lirc", SYSFS{dev}=="61:0",
    GROUP=”daemon”, MODE="0777", SYMLINK="usbdevices/remote", RUN+="/usr/local/bin/change-channel-lirc.pl"

    Obviously I want certain devices writable and executable by all users, as lirc needs to be. And I didn't give it a name because I don't need it to be in a persistant place.

    Thank you; I hope it will work better than the last attempt , and we'll see it if works just as well with Edgy. A lot of people are having real trouble with lirc, so perhaps this late reply will bubble it up.
    wgaprotest/dennister
    HTPC system: amd64 x2/3800+; A8N32-SLI Dlx; 2G RAM; Mozart case w Antec TP II 550W PS; Sata 300G + IDE 300G; Nvidia 7800GT; Hauppauge WinTV PVR-250; LG 4176B

Page 3 of 9 FirstFirst 12345 ... 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
  •