Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: How to tell what process is automounting a USB flash drive when its not in fstab?

  1. #1
    Join Date
    Jan 2008
    Beans
    93

    Question How to tell what process is automounting a USB flash drive when its not in fstab?

    Note: I did the usual web and forum search and I couldn't find anything related to the strange mounting behavior the USB drive is being treated with here.

    Specs:
    OS: Lubuntu (login session installed on top of a default install of Ubuntu 14.04 64bit /w a Gnome3 desktop as its default)
    Desktop: Lubuntu
    Window Manager: Openbox

    Description of Problem:
    Even though its not listed in "/etc/fstab", it appears that randomly (or maybe every time I login to a session) a USB flash drive that I have plugged into the computer gets automatically mounted by something on the path:
    /media/username/USBStick

    Every time I unmount this drive, I delete the "/media/username" directory (where "username" is of course whatever username I have assigned myself for the login session), but whatever is mounting this drive is recreating this directory before it mounts it there. To me this seems like it suggests that there is reference in a file someplace that is being used by whatever part of the OS is mounting this drive and this file is not "/etc/fstab" because the mount point shown above doesn't exist in that file.

    Questions:
    1.) I only want this USB drive to be mounted when I tell it to be mounted. How can I stop it from being automatically mounted? The answer to this might be in "man fstab" so I'll look that up again for the trillionth time while I wait for answers.
    1.) There are some programs that that depend on this USB drive being mounted in a specific location, is there a way to change whatever file is being referenced or whatever is auto-mounting this drive so that when this auto-mounting problem does occur it at least mounts it at the correct location?

  2. #2
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How to tell what process is automounting a USB flash drive when its not in fstab?

    External media are mounted using autofs and automount. For more info have a look at this wiki page:

    https://help.ubuntu.com/community/Autofs

  3. #3
    Join Date
    Jan 2008
    Beans
    93

    Re: How to tell what process is automounting a USB flash drive when its not in fstab?

    cariboo907

    I just checked and autofs is not installed on my system. This means that "automount" which is part of the autofs package can not be doing any auto mounting since it isn't installed.

    In fact I also did a search in synaptic for "automount", and non of the packages listed in this search result are installed.

    Is there anything else that could be causing this?
    Last edited by landstander; October 20th, 2014 at 07:38 PM. Reason: clarification.

  4. #4
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: How to tell what process is automounting a USB flash drive when its not in fstab?

    Then is is probably udisks or udisks2. Not sure what Lubuntu has.

    https://help.ubuntu.com/community/Au...ountPartitions
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  5. #5
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    2,269
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: How to tell what process is automounting a USB flash drive when its not in fstab?

    I think this is still relevant since the original install is Ubuntu 14.04 http://askubuntu.com/questions/89244...ss-preferences

  6. #6
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    5,739

    Re: How to tell what process is automounting a USB flash drive when its not in fstab?

    Quote Originally Posted by oldfred View Post
    Then is is probably udisks or udisks2. Not sure what Lubuntu has.

    https://help.ubuntu.com/community/Au...ountPartitions
    Yes - Lubuntu, Ubuntu, and Xubuntu all use udisks2 which automounts removable media at /media/username/xxxxx

    How you can tell: Examine the output of mount
    Code:
    /dev/sdb4 on /media/dmn/Common-Files type ext4 (rw,nosuid,nodev,uhelper=udisks2)
    /dev/sdc1 on /media/dmn/COMMON type vfat w,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
    Note uhelper=udisks2 - First line is a partition mounted by udisks2; second line is an external drive mounted by udisks2
    In Xubuntu at least, you can prevent automouting of external devices from Settings > Hardware > Removable Drives and Media.

  7. #7
    Join Date
    Jan 2008
    Beans
    93

    Re: How to tell what process is automounting a USB flash drive when its not in fstab?

    oldfred, nerdtron, and Dennis N;

    [Things Learned:]
    I've figured out that this problem only occurs after a reboot and not after a logout then login. After the reboot I do see the "uhelper=udisks2" at the end of the /media/username/USBStick mount point output for the USB drive when doing "mount -l" on the command line. This suggests that this is indeed a udisks2 problem.

    [Things Tried:]
    1.) After rebooting into a Gnome session to follow Dennis N's suggested "Settings > Hardware > Removable Drives and Media" path, I discovered that I have no "Removable Drives and Media" option listed in the Hardware section. Also in Lubuntu there is no "Settings" point to start from which is why I logged out and back into a Gnome session to follow your suggestion.
    2.) I attempted to follow nerdtron's suggestion of disabling an "automount" option in deconf by following the suggestion given in the link posted in comment #5 above, and this seems to have had no effect. Seems as if that deconf / automount option has no effect on how udisks2 behaves. Note: I did double check dconf after the reboot to make sure the automount setting was still disabled and it was so... *shrug* :/

    [Questions Remaining:]
    1.) Where are the settings or configuration files located for udisks2? (After doing a quick search online it seems that udisks2 is receiving some complaints from the community, http://igurublog.wordpress.com/2012/...oss-for-linux/, this makes me wonder if there is even a way to stop udisks2 from automounting USB drives).
    2.) I've read a post about forcing udisks2 via symbolic links to use "/media" by default instead of "/media/username" but this seems like a patch or a workaround and doesn't seem to address the issue that udisks2 is working outside the end users ability to decide how there system is operating on a more fundamental level. (Here is the link to the symbolic link method: http://askubuntu.com/questions/21464...mount-location). Is there a way to get rid of udisks2 all together without completely screwing up the OS, and are there any good replacements or substitutions for udisks2?

    Thanks for the answers and the support. I'll look for a udisks2 replacement or substitution and I'll try and report back one what I can dig up.

  8. #8
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    5,739

    Re: How to tell what process is automounting a USB flash drive when its not in fstab?

    The suggestion about looking at Settings > Hardware > Removable Drives and Media to turn off automounting only referred to Xubuntu. That's why I qualified it "at least in Xubuntu".

    I don't know of any configuration files for udisks2 that we can access as users. My impression is that it is not designed to be user configurable.

    udisks (which mounts devices at the old location /media/xxxx) can be installed together with udisks2, but automounting is still done by udisks2. Replacing udisks2 with udisks for automounting external devices is beyond my knowledge.

  9. #9
    Join Date
    Jan 2008
    Beans
    93

    Re: How to tell what process is automounting a USB flash drive when its not in fstab?

    [UPDATE:]
    I still can't stop the usb drive from being automatically mounted on bootup.

    [What has changed:]
    I placed a line in /etc/fstab as follows:
    Code:
    UUID=$deviceuuid 	/media/USBStick 	ext3 	rw,suid,dev,exec,noauto,nouser,async
    Where $deviceuuid is the uuid of the device being mounted (note: from the command line use "ls -l /dev/disk/by-uuid" to see a complete list of devices listed by uuid, to cross reference this list with the actual name of the device use "ls -l /dev/disk/by-label", from those two lists you should be able to discern the uuid for each device attached to the system.)

    [Problems and partial solutions:]
    Here is what "mount -l |grep USBStick" (from the command line) now reports after a reboot:
    Code:
    /dev/sde1 on /media/USBStick type ext3 (rw) [USBStick]
    Here we can see that there is no reference to udisks2, so it seems as if this drive is being mounted directly from fstab. We can also see that the device is being mounted in the correct location now instead of the strange and problematic "/media/username" directory that udisks2 forces on any one that is bound by its use on there system. So fstab sort of solves that issue, however the problem with auto-mounting is still persistent.

    In the "What has changed" section above notice that I have given the "noauto" option for this device and yet it is still being automatically mounted even though "man mount" states that this should not be happening.

    [Questions remaining:]
    1.) WTF?
    2.) How can we stop this drive from being automatically mounted by every single thing under the sun no matter what we do to stop it? (The only solution I can see is to leave it physically unplugged, which isn't good and doesn't work if for example one wanted to remotely administer the computer from some other physical location on the planet and had a need to mount that drive).
    3.) Is the only solution to write a script that unmounts this drive on bootup? Even if we do this it will be annoying because the user would have to enter there password a second time for the unmount after the first time for the login each time they boot the computer. There has to be a better way to deal with this problem then this.
    Last edited by landstander; October 22nd, 2014 at 05:43 PM.

  10. #10
    Join Date
    Jan 2008
    Beans
    93

    Re: How to tell what process is automounting a USB flash drive when its not in fstab?

    Dennis N

    Re: How to tell what process is automounting a USB flash drive when its not in fstab?

    The suggestion about looking at Settings > Hardware > Removable Drives and Media to turn off automounting only referred to Xubuntu. That's why I qualified it "at least in Xubuntu".

    I don't know of any configuration files for udisks2 that we can access as users. My impression is that it is not designed to be user configurable.

    udisks (which mounts devices at the old location /media/xxxx) can be installed together with udisks2, but automounting is still done by udisks2. Replacing udisks2 with udisks for automounting external devices is beyond my knowledge.
    Thanks for the clarification, and suggestions.

    ...Still searching for a solution (see post #9 above).

Page 1 of 2 12 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
  •