Fstab: mounting nfs with noauto,x-systemd.automount works in Dolphin, but not other applications

Hi all,

Noob here, English is not my first language. I searched the forum, but have not found a similar topic.

In my fstab I’ve got:

<redacted>:/home/<redacted>/SSD2TB /home/<redacted>/SSD2TB nfs noauto,x-systemd.automount 0 0

which works fine: the mount is active after boot.

After a while the mount, if not used for some time, will get unmounted (as expected).

In Dolphin the “not mounted” icon is visible for the mount.
By clicking on it in Dolphin the mount becomes active without fail.

But: if I use - say - LibreOffice and then try to open a file on that mount, when it is in fact not mounted, I get the message:

An error occurred while accessing '/home/<redacted>/SSD2TB', the system responded: mount.nfs: failed to prepare mount: Operation not permitted

Does this mean there is something wrong with my fstab?
Or is this a bug? If so, where (LibreOffice, nfs developers, …) should I report it?

CPU: quad core Intel Core i5-8250U (-MT MCP-) speed/min/max: 1661/400/3400 MHz
Kernel: 6.1.12-1-MANJARO x86_64 Up: 1h 44m Mem: 3110.2/3797.4 MiB (81.9%)
Storage: 238.47 GiB (16.5% used) Procs: 231 Shell: Zsh 5.9 inxi: 3.3.25

Any suggestions appreciated.
If more info is needed, please let me know.

Sem.

Instead of fstab try to use systemd mount units to see if it makes a diff…
Also don’t mount under /home but use a different dir for mounts by the system.
Mounts done by the system are by default not accessible for normal users unless given explicit permissions on the mounted directory…

I gave up on the intricacies of mounting a nfs share in fstab - it was too difficult to get right.

I am using systemd mount units because they are lean and clean.

This is no bug - it is a misconfiguration of your mount

For you scenario you need to units

one mount unit and one automount unit

The automount unit activates/starts the mount unit when the path specified is accessed and deactivate/stops the mount unit after the specified idle time.

Use the link provided above to find samples which you just need to amend to your system.

1 Like

Thanks all for your suggestions.

I did try mount units, but I failed to get it working reliably - may well be down to my own lack of knowledge.

Just to be clear: the mount (with fstab) does mount reliably. And can be used without problem. Until the mount is unmounted after some idle time. After having been idle it will automatically be remounted if I then access it through Dolphin; but not if I access it throuhg - say - libreoffice. If I first access it through Dolphin to remount I can also then access the mount through libreoffice.
That’s why I thought it might be something wrong in libreoffice.

I’ll see if I can get mount units to work.

Thanks.