Must be Superuser to use mount

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
EuroNiceguy
Posts: 39
Joined: 2023-05-15 08:08

Must be Superuser to use mount

#1 Post by EuroNiceguy »

Hi Everyone

I have used autofs for the computer to recognise and mount USB thumb drives.

When I have clicked on the thumb drive icon in the file manager, the popup with the following appears;

"Unable to access location

mount: /mnt/usb-Sandisk:
must be superuser to use mount.
dmesg(1) may have more information after failed mount system call.

Can you advise on how this can be configured for all users to be able to mount USB's and can you recommend another way if you don't recommend autofs please.



Thank you in advance,
Michael

CwF
Global Moderator
Global Moderator
Posts: 3204
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 67 times
Been thanked: 282 times

Re: Must be Superuser to use mount

#2 Post by CwF »

Methods vary, state your specifics -what DE? Gnome?
Mottainai

EuroNiceguy
Posts: 39
Joined: 2023-05-15 08:08

Re: Must be Superuser to use mount

#3 Post by EuroNiceguy »

I'm using Gnome, and using the latest Debian

EuroNiceguy
Posts: 39
Joined: 2023-05-15 08:08

Re: Must be Superuser to use mount

#4 Post by EuroNiceguy »

Hi Everyone,

I am sorry for hassling everyone, Am i able to get assistance please.


Thank you in advance,
Michael

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5472
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 21 times
Been thanked: 93 times

Re: Must be Superuser to use mount

#5 Post by dilberts_left_nut »

Why use autofs?
Doesn't gnome take care of all that?
AdrianTM wrote:There's no hacker in my grandma...

EuroNiceguy
Posts: 39
Joined: 2023-05-15 08:08

Re: Must be Superuser to use mount

#6 Post by EuroNiceguy »

Gnome didn't have anything of this nature,

When I launched the Disk utility, the USB thumb drive did show on there.

Which way would you recommend, and can you advise on how to implement the recommendation in the easiest way (noob friendly) please

lindi
Debian Developer
Debian Developer
Posts: 626
Joined: 2022-07-12 14:10
Has thanked: 2 times
Been thanked: 127 times

Re: Must be Superuser to use mount

#7 Post by lindi »

Disk Utility in Gnome talks to the udisks2 API over D-Bus. The default policy for that service allows authenticated local users to operate on removable storage devices. When you use it to mount a USB drive, it takes care to set ACLs so that other users of the system cannot access your USB drive contents. From command-line you can use "udisksctl" to do the mounting.

EuroNiceguy
Posts: 39
Joined: 2023-05-15 08:08

Re: Must be Superuser to use mount

#8 Post by EuroNiceguy »

So how do I have the computer automount any USB drive without the need to be a superuser?

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5472
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 21 times
Been thanked: 93 times

Re: Must be Superuser to use mount

#9 Post by dilberts_left_nut »

You just plug it in (after undoing whatever you did to break it in the first place).
AdrianTM wrote:There's no hacker in my grandma...

EuroNiceguy
Posts: 39
Joined: 2023-05-15 08:08

Re: Must be Superuser to use mount

#10 Post by EuroNiceguy »

I just removed autofs, and I still have the same popup come in as per attached image.
Attachments
Screenshot from 2025-01-16 06-29-10.png
Screenshot from 2025-01-16 06-29-10.png (17.92 KiB) Viewed 335 times

CwF
Global Moderator
Global Moderator
Posts: 3204
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 67 times
Been thanked: 282 times

Re: Must be Superuser to use mount

#11 Post by CwF »

I'm not a gnome, but I do expect a default gnome installation to show the usb, and with a password would mount the usb. To do so without a password there are either gnome configuration options which I don't know about, or you'll need to look into polkit permission for the gnome desktop.

Perhaps a gnome user will chime in
Mottainai

EuroNiceguy
Posts: 39
Joined: 2023-05-15 08:08

Re: Must be Superuser to use mount

#12 Post by EuroNiceguy »

I expected for Gnome to have this feature as default, or any Desktop environment for that matter.

arzgi
Posts: 1713
Joined: 2008-02-21 17:03
Location: Finland
Has thanked: 1 time
Been thanked: 98 times

Re: Must be Superuser to use mount

#13 Post by arzgi »

I have not used Gnome, desktops nowadays automount usb-plugins, i have added my username to pludgev for ages, not sure it is needed anymore. Xfce, which I use, mounts usb-[sticks, drives] to /media/$USERNAME/nnn

where $USERNAME is your username or login, nnn it usaually some random number/letter combination.

You dont need to do anything else than connect the plugin.

Would suprprised if that would not work in Gnome.

EuroNiceguy
Posts: 39
Joined: 2023-05-15 08:08

Re: Must be Superuser to use mount

#14 Post by EuroNiceguy »

Can you advise of the Terminal command for this please

Or would it be better to make me a Superuser as well as root?

cfb
Posts: 59
Joined: 2017-01-08 16:39
Been thanked: 5 times

Re: Must be Superuser to use mount

#15 Post by cfb »

This computer is running Debian 12 (GNOME) and as soon as a USB thumb drive is connected it shows up in Files and its filesystem is automatically mounted at

Code: Select all

/media/<username>/<name>
"<name>" is the UUID or a name given to the partition.
Example:

Code: Select all

$ lsblk -f /dev/sdb1
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sdb1 vfat   FAT16       43EF-2C02                              62,3M     0% /media/<username>/43EF-2C02
I have done absolutely nothing for this to work.
Last edited by cfb on 2025-01-17 07:20, edited 1 time in total.

User avatar
pbear
Posts: 533
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 84 times

Re: Must be Superuser to use mount

#16 Post by pbear »

Testing in a VM, I can confirm Gnome by default automatically mounts a USB drive. For example:

Code: Select all

pbear@debian:~$ mount | grep /dev/sd
/dev/sda2 on /media/pbear/Linux-Shuttle type ext4 (rw,nosuid,nodev,relatime,errors=remount-ro,uhelper=udisks2)
By the way, this is a default standard installation, so the primary (and only) user (besides root) does not have sudo privileges.

No idea how you got where you are. Frankly, the simplest (perhaps only) solution would be to reinstall.

EuroNiceguy
Posts: 39
Joined: 2023-05-15 08:08

Re: Must be Superuser to use mount

#17 Post by EuroNiceguy »

I am thinking of doing this.

During the installation process, is there anything you recommend during the installation process?

Mort
Posts: 10
Joined: 2024-05-17 01:05
Has thanked: 2 times
Been thanked: 1 time

Re: Must be Superuser to use mount

#18 Post by Mort »

I'm not familiar with autofs. As others have said, the flash drive should be detected as a block device, and from there mounting it is trivial. In the screenshot above, it appears that you are attempting to mount it to the /mnt directory, which can be tricky due to the file permissions in that directory. Have you tried mounting it to the /media directory?

User avatar
pbear
Posts: 533
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 84 times

Re: Must be Superuser to use mount

#19 Post by pbear »

EuroNiceguy wrote: 2025-01-17 06:39 ... is there anything you recommend during the installation process?
To solve the problem of this thread? Nothing needed. The defaults work fine for mounting with file manager, Disks (installed by default in Gnome and Cinnamon), and the disk managers used in other desktops.

One thing to know is that, as mentioned, the Standard Installer by default doesn't give the primary user sudo privileges. If you're used to using sudo, change that. There are several ways. Ask if you need guidance.

Post Reply