7

I'm running Linux Mint 14 - pretty much whatever the default install settings are. When I have multiple users logged in and I plug in a flash drive, or digital camera, or any other USB storage, rather than popping up the automount, it does nothing.

So if I use Caja (I guess the Nautilus equivalent) an try to mount it, it tells me:

                               Unable to mount 4.0 GB Volume - An Operation is already pending

If I log into the other user account I see a window asking me what action I'd like to take.

How can I turn off automount, and have it only try mounting when I click on it from within my file browser?

  • We can come up w/ a solution to automount USB from the system level, what about to unmount it? – slm Mar 2 '14 at 2:50
  • Basically it's only my wife or unmounting, and we both have sudo – Wayne Werner Mar 2 '14 at 2:52
  • That sounds funny that you and your wife have sudo. She's a special lady that can do that, mine is still struggling w/ Ubuntu. You'd explicitly unmount it then? I think you can also mount it with a "lazy" switch which will leave it in a friendlier state if it's unmounted. – slm Mar 2 '14 at 2:53
  • I updated my question - it turns out that what I really want is just to let me be in control of my own system. – Wayne Werner May 29 '14 at 17:37
  • It isn't clear that this would help in the multiple-user situation, but for some cases this error can be resolved by running caja --quit. – nobar Mar 8 '15 at 2:15
1

How can I turn off automount, and have it only try mounting when I click on it from within my file browser?

By using dconf-editor to disable auto-mounting as described here: How to disable automount in nautilus's preferences.

Alternatively, run the following command:

gsettings set org.gnome.desktop.media-handling automount false
2

This is untested but I did come across this page: automounting usb flash drives on linux with udev and pmount

The general idea is that you make a UDEV action that will automount using pmount instead. If you look in the comments there's a punmount -l which will do a lazy unmount which should be safer.

excerpt

Here is a solution for automounting usb flash drives / memory sticks on linux using only udev and pmount.

  1. add a file automount.rules in /etc/udev/rules.d.

  2. put the following lines in it

    # automounting usb flash drives
    # umask is used to allow every user to write on the stick
    # we use --sync in order to enable physical removing of mounted memory 
    # sticks -- this is OK for fat-based sticks
    # I don't automount sda since in my system this is the internal hard 
    # drive depending on your hardware config, usb sticks might be other 
    # devices than sdb*
    
    ACTION=="add",KERNEL=="sdb*", RUN+="/usr/bin/pmount --sync --umask 000 %k"
    ACTION=="remove", KERNEL=="sdb*", RUN+="/usr/bin/pumount %k"
    ACTION=="add",KERNEL=="sdc*", RUN+="/usr/bin/pmount --sync --umask 000 %k"
    ACTION=="remove", KERNEL=="sdc*", RUN+="/usr/bin/pumount %k"
    
  3. reload the udev rules: udevadm control --reload-rules

NOTE: If you want to make this setup more tolerant to unmounting then you'll want to include the -l for lazy unmounting to punmount.

ACTION=="remove", KERNEL=="sda*", RUN+="/usr/bin/pumount -l %k"

From pumount's man page:

   -l, --lazy
          Lazy unmount. Detach the filesystem from the filesystem hierarchy 
          now, and cleanup all references to the filesystem as soon as it is
          not  busy  anymore.   (Requires kernel 2.4.11 or later.) 
          IMPORTANT NOTES This option should not be used unless you really 
          know what you are doing, as chances are high that it will result 
          in data loss on the removable drive. Please run  pumount  manually  
          and  wait until it finishes. In addition, pumount will not 
          luksClose a device which was unmounted lazily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.