Web lists-archives.com

Re: Controling automactic mounting USB storage devices

On Tue, 1 Jan 2019 06:24:58 -0600
Richard Owlett <rowlett@xxxxxxxxxxx> wrote:

> All my machines have MATE desktop. They are various releases of
> Jessie and Stretch.
> If the USB device is connected at boot, the individual partitions can
> be unmounted.
> However, if the device is connected after boot individual partitions
> can not be unmounted with the GUI.
> What controls this action?

I believe the rationale is that if you want to unmount the *device* you
only need to click one icon instead of several for multiple partitions.
Clicky people tend to want minimum effort. I don't know whether it is
the file manager that issues multiple unmounts, or a single unmount to
the device, or whether it is systemd being helpful.

I'm happy with it: if I really want just one to be unmounted, then I
am doing something a bit technical and probably have a terminal open
anyway. I also want to be very sure of what I'm doing. Most potentially
destructive tools will not run on a mounted filesystem, but I'd prefer
not to trust that.

File manager GUIs tend to be limited in various ways, they are
generally fine for actual use of the computer, but for admin work, a
terminal gives you precise control. Not least, they are generally a bit
buggy and I wouldn't like to run any of them with root privileges. A
semi-GUI file manager is mc, run from a terminal either with or without
sudo. I invariably use sudo, as I use mc exclusively for admin work,
and I know I am always root and (generally) am not careless.

Linux is fairly configurable, but there have to be limits. If you need
something that isn't provided, that not enough other people want, it's
time to learn some system programming.

> An acceptable alternative that when connected the device is not 
> automatically mounted but just appears in the Places menu.

You may be able to do this: Try writing fstab entries for each drive
you're worried about, and tell systemd not to mount immediately but to
automount when you actually request data from the partition. I have a
fair number of network drives, all set up that way so as not to slow
down booting. I don't know for sure if it will work with removable

Dig some more into what does what: it doesn't bother me, but I have a
fairly lightweight Stretch on a netbook, with Thunar as the only GUI
file manager. If I try to use ssh or openvpn with keys on a USB stick
(without an fstab entry), the action fails. I have to open a file
viewer on the partition first, before the key can be retrieved, though
the stick partitions do show up in Thunar before mounting. I didn't do
anything to achieve this, it's just how things are. But the
installation is a very different one to that of my main workstation,
which does mount all partitions on plug-in.