>>> On one of my (Debian stable) machines, all the partitions that aren't
>>> mentioned in /etc/fstab end up mounted in /media/root/<UUID>, and that's
>>> apparently a "feature" of `udisks2`.
>>>
>>> How can I tell udisks2 to refrain from doing that?
>
> If you do not like automounting on connecting a drive then change settings
> of your desktop environment.

FWIW, this is a headless SBC I use as home server.  I do connect it to
an HDMI screen occasionally when I need to debug boot issues, but
I don't have any Xorg or Wayland installed on it.

I do occasionally log into it as root over the serial connection.
Maybe that's what triggers the auto-mount?

> If you do not like that mounted partitions can not be accessed by
> users other than root then add udev hints for specific partitions, see
> udisks(8) and

No, it's rather than I don't like those filesystems being mounted at all
(it gets in the way of messing with the filesystem behind the kernel's
back, for example).

>> I'm not sure if it's the best/easiest way, but in the past I've used
>> udev rules with ENV{UDISKS_IGNORE}="1":
>>      https://wiki.archlinux.org/title/Udisks#Hide_selected_partitions
> It is used by desktop environment automounters and file managers rather than
> udisks itself.

The only file manager I use as root is `zsh`.  🙂

>> You could instead put the thing in fstab with a "noauto" as one of its
>> mount options.  Then it wouldn't be mounted by the system at boot, nor by
>> udisks.

That's an idea.  I'd have preferred a way to avoid having to list each
and every such partition, but it's better than nothing, thanks.

> It is a viable approach as well since arbitrary mount point may be specified
> instead of /media/LABEL and /media/UUID hardcoded in udisks2. Users are
> still able to do "udisksctl mount -b ...".

Oh, right.  Hmm....


        Stefan

Reply via email to