[SOLVED] Re: Stop udisks2 mounting my partitions?
>> 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?
>
> 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
So far it seems to be the best option, thank you. Sadly the doc I found
doesn't say what is the meaning/effect of `UDISKS_IGNORE/SYSTEM/AUTO`
nor what values those vars can take (e.g. I had tried "yes" instead of
"1" and that seem to have no effect).
> 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.
I have a growing number of such partitions, so it's not very practical.
> Although it is udisks2 and udev that are facilitating this, I thought it
> only happened inside a desktop environment. Though your example of
> /media/root/UUID suggests not. Anyway, some ideas for desktop
> environments:
In my case it's FreedomBox which does it, so you can just plug in a USB
key or SD card into your machine and have it accessible without any
extra work. I can see the desire for it, but in my case it's
significantly harder to plug something into the "box" than it is to ssh
to it and type `mount`. 🙁
Also, in my case about half the time I connect a USB key or an SD card
it's not to access its contents but to write a whole new image onto it
(partition table and all), so auto-mounting is really not helpful.
For the record, the solution I used is simply to create a one-line file:
# cat /etc/udev/rules.d/99-my-stop-udisk.rules
ENV{UDISKS_IGNORE}="1"
#
Thank you everyone for your help along the way.
Stefan
Reply to: