fstab mount doesn't wait for wifi connection

Until now I’ve had my computer hardwired to the router. I’ve since moved and cant have the computer close enough to the router to use a CAT6 connection. So now my NAS won’t mount because fstab tries to mount it before the wifi connection comes up. I tried adding “_netdev” to the fstab but it made no difference. I’, already getting tired of mounting the NAS manually on each boot.

Any ideas?

Thanks.

Perhaps use “wicked” for your WiFi (instead of “NetworkManager”).

Perhaps use “autofs” for mounting.

I’d recommend trying systemd.automount. This can be via an fstab entry with ‘noauto’ and ‘x-systemd.automount’ options, and systemd will take care of the rest for you

man systemd.automount

https://www.freedesktop.org/software/systemd/man/systemd.mount.html

I already am using automount.
Here is what I have:

/home xfs defaults 1 2
//Vomitus/music /home/dave/NASMusic cifs noauto,x-systemd.automount,vers=1.0,_netdev,username=xxxxx,password=xxxxxxx,uid=1000,gid=100,iocharset=utf8,sec=ntlm 0 0

This worked fine until I went wifi.

So whats wrong?

Assuming that you’re using NM? Have you tried using “NetworkManager-wait-online.service”?

sudo systemctl start NetworkManager-wait-online.service

Enabled permanently (at boot) with

sudo systemctl enable NetworkManager-wait-online.service

NetworkManager-wait-online.service works though it slows down boot up a bit but I will use it for the time being.

Thanks

That might be a reflection of the time it needs for your wifi connection to become active. Have you defined your wifi connection as a system-connection, and defined so that it starts before a user logs in to the desktop? If you only have one network environment to connect to, then consider using wicked instead of NetworkManager as Neil already mentioned.

More info:
https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.nm.html#sec.nm.usecase
https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.nm.html#sec.nm.sec.types

I was wrong, NetworkManager-wait-online.service only works sometimes. Guess I will try switching to wicked.

Dave

Yes I have NM set for all users but it still doesn’t start the connection until you have logged in. I’ve gone through the setup and don’t see any way to make it start before login.

If this system is not one that is walked around to connect to different networks all the time, why using NM (and bothering the users with connecting,etc.)?

Use Wicked and it will be connected at boot (well that should be configured as such when you use YaST to configure Wicked, but IIRC it is the default).

If you are using KDE, then you have to configure the network connection to store the network key in a file unencrypted. I think that’s the default for Gnome, but not for KDE. Then, if the connection is shared for all users, it should attempt to connect before any login.

I do use KDE and I do have the network key stored.

If you have configured the connection with ‘Automatically connect to this network when it is available’ , ‘All users may connect to this network’ and ‘Store password for all users (unencrypted)’ then it will be started at boot before before you log in to the desktop. (The credentials are then stored in root-owned /etc/NetworkManager/system-connections directory.)