[SOLVED] USB thumbdrive is being auto-mounted under root ownership

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
SilverBear

[SOLVED] USB thumbdrive is being auto-mounted under root ownership

Post by SilverBear »

Hello, all.
I have a problem that I've been trying to research & fix for over a week, and it's time to admit I need help. Despite my low forum ranking here I'm not a noob @ gnu-linux. Despite having used one distro or another as my main OS for over 10 years, there is some brick wall (or blind spot) I can't seem to get past.

I've been running Mint 18 KDE (64) as my main distro. I did a fresh install when I integrated a new SSD into my desktop box a couple months ago.
[ Intel core i7, 8GB RAM, nVidia GeF* 950GTX --none of which should affect the issue, but I include it FYI.]
The Problem:
When I plug in a USB flash "thumbdrive" it gets auto-mounted under /media/usb0 and is owned by root, with rwxr-xr-x permissions -- instead of under /media/silverbear owned by me.

Code: Select all

silverbear@masaI7 /media $ ls -al
total 52
drwxr-xr-x  12 root       root       4096 Apr 23 12:21 .
drwxr-xr-x  26 root       root       4096 Apr 10 13:02 ..
drwxr-x---+  2 root       root       4096 Mar  5 22:18 root
drwxrwxrwx+  2 silverbear silverbear 4096 Apr 21 20:54 silverbear
lrwxrwxrwx   1 silverbear silverbear    4 Apr  7 19:15 usb -> usb0
drwxr-xr-x   3 root       root       8192 Dec 31  1969 usb0
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb1
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb2
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb3
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb4
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb5
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb6
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb7
The Weirdness:
1] Thumbdrive is factory-formatted FAT, and I've never messed with reformatting it. It shouldn't HAVE restricted permissions at all.
Yes, I know it's the mount-point that has the permissions. This leads us to Weirdness Factor #2:
2] When no thumbdrive is plugged in, that same (now empty) /media/usb0 mountpoint is owned by "silverbear."

Code: Select all

silverbear@masaI7 /media $ ls -al
total 48
drwxr-xr-x  12 root       root       4096 Apr 23 12:21 .
drwxr-xr-x  26 root       root       4096 Apr 10 13:02 ..
drwxr-x---+  2 root       root       4096 Mar  5 22:18 root
drwxrwxrwx+  2 silverbear silverbear 4096 Apr 21 20:54 silverbear
lrwxrwxrwx   1 silverbear silverbear    4 Apr  7 19:15 usb -> usb0
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb0
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb1
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb2
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb3
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb4
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb5
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb6
drwxr-xr-x   2 silverbear silverbear 4096 Apr  7 19:15 usb7
Last points to understand:
a] I don't use a thumbdrive very often, only when I need to transfer files to one of the other household computers (portables). But the last time I wanted to use this very thumbdrive, it worked fine. Since I can't remember exactly when that was, I don't know what I may have done to the system just before it went crackers. Possibly a kernel update. AFAIK, that's never created this kind of issue --certain not for me, anyway.
b] Thinking something I did might be something that messed my polkit, I booted the Mint 18.1-64 KDE install disk. Automounting works just as one would expect, mounting the thumbdrive under /media/mint (the default user). The contents of the subdirectory /etc/polkit-1 are the same as on my install, as are the contained .conf files.
c] I've experimented with KDE's Settings > Hardware > Removable Storage, thinking it might be a KDE-based problem. No joy.

Bottom line: it seems some process is changing the automounted thumbdrive's mountpoint and it's ownership to root.

Anybody have the foggiest idea how to help an old bear out on this puzzler? I'd really rather not have to do a complete reinstall on my SSD.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: USB thumbdrive is being auto-mounted under root ownership

Post by altair4 »

When I plug in a USB flash "thumbdrive" it gets auto-mounted under /media/usb0
There is only one thing on earth that does that and it's the package:usbmount
It's designed for a server not a desktop system and interferes with the way a desktop system auto mounts usb devices under /media/$USER. Uninstall the package.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
SilverBear

Re: USB thumbdrive is being auto-mounted under root ownership

Post by SilverBear »

altair4 wrote:
When I plug in a USB flash "thumbdrive" it gets auto-mounted under /media/usb0
There is only one thing on earth that does that and it's the package:usbmount
It's designed for a server not a desktop system and interferes with the way a desktop system auto mounts usb devices under /media/$USER. Uninstall the package.
YES!!

Many thanks, altair4!
User avatar
JerryF
Level 16
Level 16
Posts: 6572
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: USB thumbdrive is being auto-mounted under root ownership

Post by JerryF »

altair4 wrote:
When I plug in a USB flash "thumbdrive" it gets auto-mounted under /media/usb0
There is only one thing on earth that does that and it's the package:usbmount
It's designed for a server not a desktop system and interferes with the way a desktop system auto mounts usb devices under /media/$USER. Uninstall the package.
Side post to altair4: Forbidden Planet one of your favorite movies?
Locked

Return to “Storage”