mount nfs share via WiFi on boot

Hello,

I installed 15.2 with KDE desktop with autologin with username, and want to mount nfs share via WiFi on boot (to access home NAS)
I put

10.10.2.104:/film                  /opt/film  nfs4  nfsvers=4.2,auto 0  0

to /etc/fstab but the share is not mounted on boot.

sudo systemctl status opt-film.mount
● opt-film.mount - /opt/fili
   Loaded: loaded (/etc/fstab; generated; vendor preset: disabled)
   Active: active (mounted) (Result: exit-code) since Mon 2020-09-21 17:40:45 MSK; 3min 51s ago
    Where: /opt/film
     What: 10.10.2.104:/film
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 1484 ExecMount=/usr/bin/mount 10.10.2.104:/film /opt/film -t nfs4 -o nfsvers=4.2 (code=exited, status=32)
    Tasks: 0
   CGroup: /system.slice/opt-film.mount

if after boot I open terminal and run “sudo mount /opt/film”, it will be mounted after enter root password.
Is it possible to mount the share on boot?
I think first step must be connect to WiFi and next mount. but how?

Are you using Network Manager? And are you letting the user connect to the Wifi at/after his/her login?
Then it is logical that there is no network (Wifi) connection at boot and thus mount on boot is impossible.

You must see that the network is connected at boot. Either (when this is a system with a fixed place, always connecting to the same network) by switching to Wicked, or (when this is a “walk around” system that regularly connects to several different networks) by configuring in Network Manager that the particular connection is a “system” connection.

it looks like that I use network manager

sudo systemctl show -p Id network.service
Id=NetworkManager.service

I’ve connect via right down corner with WiFi icon in KDE. How can I connect to network on boot?
Did you mean “Wicked” https://www.suse.com/media/presentation/wicked.pdf ?

Not wicked see:
https://doc.opensuse.org/documentation/leap/reference/html/book-opensuse-reference/cha-nm.html#sec-nm-configure

To make your connection available as a system connection go to the Identity tab and set the check box Make available to other users. For more information about user and system connections, see Section 28.4.1, “User and System Connections”.

It is described for Gnome but Plasma is aeqivalent.

Another solution, which is independent of how you configure your network, is using autmounter. The NFS export will then only be mounted when it is to be used. There is of course the good old automounter, which is easy to configure, but nowadays there is systemd.automount, which is even easier.

10.10.2.104:/film                  /opt/film  nfs4  nfsvers=4.2,noauto,nofail,x-systemd.automount,x-systemd.mount-timeout=10 0  0

That is all (but you may want to change the timeout to another value).

Sorry, but I was a bit hastened in my post and want to add a bit to it.

I assume (from the name of thedirectories involved: film) that this file system is to be accessed by logged in end-users. Thus it will not be used before a user is logged in and, by doing that, made the network connection (through NM).
Thus irrespective if the network is upped at boot or at login, when a user wants to see a film, it will be there through the automount.

Maybe, because of much confusion about the word “automount”. It seems that it is used in several meanings:

  • connected to the file system independent mount option (no)auto, which rules if the mount is to be included at mount -a (also at boot);
  • the automounter (now in two incarnations, old automount configured in auto.master and new systemd,automount) that mounts when required (and umounts after a certain time of no requirement);
  • some people call the mount through the desktop of spontanious connected mass-storage (e.g. USB stick) automounting, probably because they do not know what happens and when people do not understand how a computer action works, they often think it is automagic.

doesn’t help Screenshot by Lightshot

I’m not sure of your current setup.

If you are using KDE, then you also need to set it to save your connection password in a file unencrypted. That setting should be in the WiFi connection security tab. If I recall, it is an icon on the same line as where you enter the passphrase.

If that sounds insecure, it really isn’t. The passphrase will be saved in a file that is readable only by root or by providing the root password.