Mounting network shares at 15.2?

When I was running 15.1, I had the following entries in /etc/fstab:

rpi-nas-osmc.localnet:/media/RED128G       /ourPhotos      nfs   defaults                     0  0
rpi-nas-osmc.localnet:/media/BLACK128G     /ourVideos      nfs   defaults                     0  0

This worked fine for me as a User. I think I had it working as a “lazy or delayed” (I forget the details now) network share, in that it did not connect until I wanted to use these shares.
Now that I have upgraded to 15.2, I can no longer access these shares as a User. Root is fine. And once mounted, users can access them too.

Is it possible to get back to how it used to work (by amending FSTAB?). The NAS end has not changed.

Regards, M.

The wording “can no longer access as user” may express your feeling, but they do not provide much information about what that user does, and what (s)he then gets.

In any case, checking the ownership and permissions of the mount points is a good idea

ls -ld ourPhotos
ls -ld ourVideos

I re-read and tried to understand what you mean.

You /etc/fstab (not FSTAB, using the wrong case is very confusing in Unix/Linux) entries means that they should be mounted at boot. Do I understand that that is not the case?

Are they configured using the automounter (using auto.master)?

Is the network using Wicked or Network Manager?

Yep! I take your point, Henk.


mprowe@gzunder:/> ls -ld ourVideos
drwxrwxrwx 2 root root 4096 Aug 13  2019 ourVideos
mprowe@gzunder:/> ls -ld ourPhotos
drwxrwxrwx 2 root root 4096 Sep 19  2018 ourPhotos

Use case - pre upgrade to 15.2:
Switch on PC. /etc/fstab (et al) does its thing. User opens Dolphin and sees that the two network shares have not mounted. No problem - the user selects the required share and it mounts and opens the folder.

Use case - post 15.2 upgrade.
Switch on PC. /etc/fstab does its thing. User opens Dolphin and sees that the two network shares have not mounted. The user now selects the required share but it will not mount, giving a message that mount is Root Only.

The remote shares have not changed.

Regards, M.

They are not “shares” (probably a Microsoft Windows type of expression), they are NFS exports.

Then, FSTAB does nothing. And fstab does also nothing. /etc/fstab is a configuration file. It has entries that configure file systems by their device, their type, their mount points and options. This configuration file is used by mount when an individual mount whith only the device contaning the file system, or the mount point is given. The mount program then finds all else it needs in /etc/fstab.

At boot (the equivalent of) mount -a is done. Which means that all entries in /etc/fstab are used one by one and unless there is the option noautomount, the entry is used to mount.

Now the question is why your NFS mounts are not honoured during boot anymore.

Your post above and my post above that may have passed each other. So can you place explain how your network is configured. Because the network needs to function before you can do any remote mount of course.

Network Manager. Is that a meaningful description or do you need more.

Maybe we should just forget all ideas about how it worked earlier and how it does not work now.

I can offer you a way to do this. I use it myself and after showing it to others here they use it and are glad with it. So take the chance. And you can always go back to what you have now of course when you save those lines in your /etc/fstab somewhere before you change them.

My suggestion:

rpi-nas-osmc.localnet:/media/RED128G       /ourPhotos      nfs noauto,nofail,x-systemd.automount,x-systemd.mount-timeout=10,x-systemd.idle-timeout=5min                     0  0

(and of course similar for the other one).

noaouto: not to be mounted on boot.
nofail: do not report errors for this device if it does not exist (probably not needed, but it does not hurt).
x-systemd.mount: mount on demand, that is when any user tries to access anything inside that file system.
x-systemd.mount-timeout=10: stops when the mount does not seucceed after 10 mins, will probably only happen when the NFS server is out of order, you can of course adapt the time.
x-systemd.idle-timeout=5min: when the file system is not in use for 5minutes, it will be dismounted, you can adapt that also if you like.

As is already suggested by the option names, it is using the systemd automount function. It is rather new (like systemd itself) and it is a good and easy replacement for the automounter. Works here like a charm.

It has the advantage that mounting takes only place when a user goes there. Which means that the user is loged in and even when NetworkManager is uses, then the network will functiom.

Thank you Henk,

That worked a treat.

Regards, M.

Nice! Congratulations and enjoy.

Network Manager does not start the network until the user logs on unless the allow all users option is used in the Network Manager configuration.

So if the network is not up when the mount -a at boot happens the network drives will not be seen.

nofail option prevents problems with none available drives

This is already solved (I think the OP explained that with: 'That worked a treat.").
It is solved in a way that is independent of how the network is managed, being it NetworkManager, Wicked or systemd-network.