I want every USB media (ext, ntfs, FAT…) inserted to be available with full read-writable to every user. Preferably under mnt
and as group common
.
( Ubuntu-MATE 21.04, though my issues actually date back even to Ubuntu-MATE 16.04...)
- I boot into my machine as user frank. When I mount an USB drive (FAT) it ends up under
/media/frank/4C8C-E4BC
– just fine, as it should. When I switch to another user (keeping the first session open, not logging off, i.e. dm-tool switch-to-user lisa
) I get
Unable to mount 16 GB Volume
Device /dev/sda1 is already mounted at /media/lisa/4C9C-xxxx
Making sense so far. But not what I want.
Sure, for individual drives I could change the mount location via gnome-disks
or manually add a line to etc/fstab
(which essentialy is what gnome-disks
is doing). However I do not want to do this for each and every USB stick and SD card I posess...
Is there a better way for an all-user automount?
[ I understand/guess there's something called autofs handles the automatic mounting of USB sticks? But as far as I can tell, that's no part of my Ubuntu-MATE install... ]
And then there seems to be “udev-Rules”, is that, what I want? Apparently it's even an “inevitable” part of Ubuntu, as it is part of systemd (?)? There are rules on my machine under /etc/udev/rules.d although seemingly rather specific ones about brave and skype and signal...)
There's promising stuff MODE
and GROUP
and UDISKS_FILESYSTEM_SHARED
but (provided this is the right approach) I can't set the ultimate puzzle pieces together. It should truly only apply to removable drives like USB sticks and memory cards, otherwise I get into deep trouble... this source mentions SUBSYSTEMS=="usb"
, that would be a good filter, if true...)
Is udev
rulez the way?
If yes, can somebody set the puzzle pieces together?
I am almost suspecting all I look for is a one-liner file in /etc/udev/rules.d.
addendum:
Not my main problem, but if it went away for the same reasons, I would be happy: Inserting a Windows Boot USB Stick (slightly more commplex, comes with an UEFI Boot FAT and a Windows Install NTSF partition) under the second user, I instantly get:
(and no, intense googling didn't get me anywhere) …switching back to first user frank (stick still inserted) I am welcomed by these authorization requests:
addendum:
Not a fix, but if those two users are essentially you, and the other one is not truly active (just switched-away from instead of logged-out) this is the quickest way before a trouble-free USB mount:
who -u
sudo kill <that other user's pid>