Announcement

Collapse
No announcement yet.

Mounting via device notifier and udev rules?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mounting via device notifier and udev rules?

    I've created a rule in /etc/udev/rules.d/50-custom.rules that reads

    KERNEL=="sd?1", ACTION=="add", SUBSYSTEMS=="scsi", ATTRS{vendor}=="Western Digital", ATTRS{model}=="My Passport 070A", SYMLINK+="mypassport"

    Ideally, I'd like to run a script, but it's not even creating the symlink. I am mounting the external by clicking on device notifier. Is it possible that there is a permissions issue between this auto-mounting and the udev rule so that it doesn't get executed? The symlink never shows up. If I remove the symlink and run a script that echoes some junk into a file, it also doesn't get executed. I made sure to use the full path and that it worked locally.

    #2
    Doing that with udev can be dangerous, because udev isn't smart enough to auto-unmount and clean up file handles when you unplug a drive. See this Arch Linux forum thread, in which someone created a script and packaged it up, only to end up removing it later.

    KDE can handle automounts and auto-unmounts via udisks already anyway. See System Settings | Removable Devices.

    Comment


      #3
      Originally posted by SteveRiley View Post
      Doing that with udev can be dangerous, because udev isn't smart enough to auto-unmount and clean up file handles when you unplug a drive. See this Arch Linux forum thread, in which someone created a script and packaged it up, only to end up removing it later.

      KDE can handle automounts and auto-unmounts via udisks already anyway. See System Settings | Removable Devices.
      I'm not trying to control mounting via udev. I'm trying to run a (backup) script when a certain disk is mounted. I can't do this via system settings AFAICT.

      Comment


        #4
        Try the more complete Udev rule script here: http://codepad.org/LOP2XwXY

        Comment

        Working...
        X