[SOLVED] NFS shares not mounted at boot

[SOLVED] NFS shares not mounted at boot

Postby nickdegraeve » Mar 29th, '24, 14:31

I have a set of NFS shares on my NAS that I want mounted on boot but it fails everytime.
I created the config via MCC's "Access NFS shared frives and directories".

Excerpt from the log with what I believe is the relevant info:
Code: Select all
[nick@HAL9000 ~]$ journalctl -b
Mar 29 13:00:53 HAL9000 kernel: Linux version 6.6.22-desktop-1.mga9 (iurt@rabbit.mageia.org) (gcc (Mageia 12.3.0-3.mga9) 12.3.0, GNU ld (GNU Binutils) 2.40) #1 SMP PREEMPT_DYNAMIC Sun Mar 17 18:04:51 UTC 2024
Mar 29 13:00:53 HAL9000 kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-6.6.22-desktop-1.mga9 root=/dev/mapper/fedora-01 ro splash quiet noiswmd nokmsboot resume=/dev/fedora/00 audit=0
...
Mar 29 13:00:53 HAL9000 kernel: igc 0000:04:00.0: 4.000 Gb/s available PCIe bandwidth (5.0 GT/s PCIe x1 link)
Mar 29 13:00:53 HAL9000 kernel: igc 0000:04:00.0 eth0: MAC: 04:7c:16:d1:b9:1e
...
Mar 29 13:00:53 HAL9000 kernel: igc 0000:04:00.0 enp4s0: renamed from eth0
...
Mar 29 13:01:03 HAL9000 network[1717]: Bringing up interface enp4s0:  [  OK  ]
...
Mar 29 13:01:03 HAL9000 systemd[1]: Started network.service.
...
Mar 29 13:01:06 HAL9000 kernel: igc 0000:04:00.0 enp4s0: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
Mar 29 13:01:07 HAL9000 network-up[1716]: Waiting for network to be up[  OK  ]
Mar 29 13:01:07 HAL9000 systemd[1]: Started network-up.service.
Mar 29 13:01:07 HAL9000 systemd[1]: Reached target network.target.
Mar 29 13:01:07 HAL9000 systemd[1]: Reached target network-online.target.
...
Mar 29 13:01:07 HAL9000 systemd[1]: Mounting mnt-ds-backups.mount...
Mar 29 13:01:07 HAL9000 systemd[1]: Mounting mnt-ds-homes.mount...
Mar 29 13:01:07 HAL9000 systemd[1]: Mounting mnt-ds-music.mount...
Mar 29 13:01:07 HAL9000 systemd[1]: Mounting mnt-ds-photo.mount...
Mar 29 13:01:07 HAL9000 systemd[1]: Mounting mnt-ds-public.mount...
Mar 29 13:01:07 HAL9000 systemd[1]: Mounting mnt-ds-scans.mount...
Mar 29 13:01:07 HAL9000 systemd[1]: Mounting mnt-ds-video.mount...
...
Mar 29 13:01:07 HAL9000 mount[2178]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/backups on /mnt/ds/backups
Mar 29 13:01:07 HAL9000 mount[2192]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/scans on /mnt/ds/scans
Mar 29 13:01:07 HAL9000 mount[2190]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/public on /mnt/ds/public
Mar 29 13:01:07 HAL9000 mount[2195]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/video on /mnt/ds/video
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-backups.mount: Mount process exited, code=exited, status=32/n/a
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-backups.mount: Failed with result 'exit-code'.
Mar 29 13:01:07 HAL9000 systemd[1]: Failed to mount mnt-ds-backups.mount.
Mar 29 13:01:07 HAL9000 systemd[1]: Dependency failed for remote-fs.target.
Mar 29 13:01:07 HAL9000 systemd[1]: remote-fs.target: Job remote-fs.target/start failed with result 'dependency'.
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-public.mount: Mount process exited, code=exited, status=32/n/a
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-public.mount: Failed with result 'exit-code'.
...
Mar 29 13:01:07 HAL9000 mount[2180]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/homes on /mnt/ds/homes
Mar 29 13:01:07 HAL9000 systemd[1]: Failed to mount mnt-ds-public.mount.
Mar 29 13:01:07 HAL9000 mount[2182]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/music on /mnt/ds/music
Mar 29 13:01:07 HAL9000 mount[2186]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/photo on /mnt/ds/photo
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-scans.mount: Mount process exited, code=exited, status=32/n/a
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-scans.mount: Failed with result 'exit-code'.
Mar 29 13:01:07 HAL9000 systemd[1]: Failed to mount mnt-ds-scans.mount.
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-video.mount: Mount process exited, code=exited, status=32/n/a
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-video.mount: Failed with result 'exit-code'.
Mar 29 13:01:07 HAL9000 systemd[1]: Failed to mount mnt-ds-video.mount.
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-homes.mount: Mount process exited, code=exited, status=32/n/a
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-homes.mount: Failed with result 'exit-code'.
Mar 29 13:01:07 HAL9000 systemd[1]: Failed to mount mnt-ds-homes.mount.
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-music.mount: Mount process exited, code=exited, status=32/n/a
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-music.mount: Failed with result 'exit-code'.
Mar 29 13:01:07 HAL9000 systemd[1]: Failed to mount mnt-ds-music.mount.
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-photo.mount: Mount process exited, code=exited, status=32/n/a
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-photo.mount: Failed with result 'exit-code'.
Mar 29 13:01:07 HAL9000 systemd[1]: Failed to mount mnt-ds-photo.mount.
...

Each of the shares has a similar status:
Code: Select all
[nick@HAL9000 ~]$ systemctl status mnt-ds-backups.mount
× mnt-ds-backups.mount - /mnt/ds/backups
     Loaded: loaded (/etc/fstab; generated)
     Active: failed (Result: exit-code) since Fri 2024-03-29 13:01:07 CET; 20min ago
      Where: /mnt/ds/backups
       What: 192.168.1.2:/volume1/backups
       Docs: man:fstab(5)
             man:systemd-fstab-generator(8)
        CPU: 7ms

Mar 29 13:01:07 HAL9000 systemd[1]: Mounting mnt-ds-backups.mount...
Mar 29 13:01:07 HAL9000 mount[2178]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/backups on /mnt/ds/backups
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-backups.mount: Mount process exited, code=exited, status=32/n/a
Mar 29 13:01:07 HAL9000 systemd[1]: mnt-ds-backups.mount: Failed with result 'exit-code'.
Mar 29 13:01:07 HAL9000 systemd[1]: Failed to mount mnt-ds-backups.mount.

After I login I can mount the the manually without any problem:
Code: Select all
[nick@HAL9000 ~]$ sudo mount -av
/                        : ignored
/boot/EFI                : already mounted
/home                    : already mounted
/media/windows           : already mounted
mount.nfs: timeout set for Fri Mar 29 13:26:42 2024
mount.nfs: trying text-based options 'wsize=8192,rsize=8192,soft,vers=4.2,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'wsize=8192,rsize=8192,soft,vers=4,minorversion=1,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'wsize=8192,rsize=8192,soft,vers=4,addr=192.168.1.2,clientaddr=192.168.1.4'
/mnt/ds/backups          : successfully mounted
mount.nfs: timeout set for Fri Mar 29 13:26:42 2024
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4.2,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4,minorversion=1,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4,addr=192.168.1.2,clientaddr=192.168.1.4'
/mnt/ds/homes            : successfully mounted
mount.nfs: timeout set for Fri Mar 29 13:26:42 2024
mount.nfs: trying text-based options 'wsize=8192,rsize=8192,soft,vers=4.2,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'wsize=8192,rsize=8192,soft,vers=4,minorversion=1,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'wsize=8192,rsize=8192,soft,vers=4,addr=192.168.1.2,clientaddr=192.168.1.4'
/mnt/ds/music            : successfully mounted
mount.nfs: timeout set for Fri Mar 29 13:26:42 2024
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4.2,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4,minorversion=1,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4,addr=192.168.1.2,clientaddr=192.168.1.4'
/mnt/ds/photo            : successfully mounted
mount.nfs: timeout set for Fri Mar 29 13:26:42 2024
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4.2,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4,minorversion=1,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4,addr=192.168.1.2,clientaddr=192.168.1.4'
/mnt/ds/public           : successfully mounted
mount.nfs: timeout set for Fri Mar 29 13:26:42 2024
mount.nfs: trying text-based options 'wsize=8192,rsize=8192,soft,vers=4.2,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'wsize=8192,rsize=8192,soft,vers=4,minorversion=1,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'wsize=8192,rsize=8192,soft,vers=4,addr=192.168.1.2,clientaddr=192.168.1.4'
/mnt/ds/scans            : successfully mounted
mount.nfs: timeout set for Fri Mar 29 13:26:42 2024
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4.2,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4,minorversion=1,addr=192.168.1.2,clientaddr=192.168.1.4'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'rsize=8192,wsize=8192,soft,vers=4,addr=192.168.1.2,clientaddr=192.168.1.4'
/mnt/ds/video            : successfully mounted
/proc                    : successfully mounted
swap                     : ignored


Any idea how to fix this?
Thanks.
Last edited by nickdegraeve on Apr 5th, '24, 06:48, edited 1 time in total.
nickdegraeve
 
Posts: 51
Joined: Mar 18th, '12, 08:01

Re: NFS shares not mounted at boot

Postby sturmvogel » Mar 29th, '24, 15:55

It seems you have set a to high NFS version.
sturmvogel
 
Posts: 734
Joined: Jul 30th, '12, 00:39

Re: NFS shares not mounted at boot

Postby doktor5000 » Mar 29th, '24, 21:23

You didn't really post your fstab entries ... for one, the NFS shares are mounted too early when network is not up, that is the first problem during boot. Marking them with the _netdev option should fix that.
And as sturmvogel mentioned already version 4.0 seems to be the highest supported NFS version from your NAS, so you'd need to adjust your fstab entries for that too.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18013
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: NFS shares not mounted at boot

Postby nickdegraeve » Mar 30th, '24, 16:02

Thanks for the replies.

I added the version and "_netdev".
Code: Select all
[nick@HAL9000 ~]$ cat /etc/fstab
...
192.168.1.2:/volume1/backups /mnt/ds/backups nfs nosuid,wsize=8192,rsize=8192,soft,vers=4.0,_netdev 0 0
192.168.1.2:/volume1/homes /mnt/ds/homes nfs rsize=8192,nosuid,wsize=8192,soft,vers=4.0,_netdev 0 0
192.168.1.2:/volume1/music /mnt/ds/music nfs nosuid,wsize=8192,rsize=8192,soft,vers=4.0,_netdev 0 0
192.168.1.2:/volume1/photo /mnt/ds/photo nfs rsize=8192,nosuid,wsize=8192,soft,vers=4.0,_netdev 0 0
192.168.1.2:/volume1/public /mnt/ds/public nfs nosuid,rsize=8192,wsize=8192,soft,vers=4.0,_netdev 0 0
192.168.1.2:/volume1/scans /mnt/ds/scans nfs nosuid,wsize=8192,rsize=8192,soft,vers=4.0,_netdev 0 0
192.168.1.2:/volume1/video /mnt/ds/video nfs rsize=8192,nosuid,wsize=8192,soft,vers=4.0,_netdev 0 0
...

This helps with the version warnings but it doesn't make it mount on boot.

Is "_netdev" a valid option?
I checked the man page of nfs and "_netdev" is never mentioned.

I googled some more and came across this page: https://geraldonit.com/2023/02/25/auto-mount-nfs-share-using-systemd/
I modified fstab accordingly:
Code: Select all
[nick@HAL9000 ~]$ cat /etc/fstab
...
192.168.1.2:/volume1/backups /mnt/ds/backups nfs nosuid,wsize=8192,rsize=8192,soft,vers=4.0,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s 0 0
192.168.1.2:/volume1/homes /mnt/ds/homes nfs rsize=8192,nosuid,wsize=8192,soft,vers=4.0,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s 0 0
192.168.1.2:/volume1/music /mnt/ds/music nfs nosuid,wsize=8192,rsize=8192,soft,vers=4.0,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s 0 0
192.168.1.2:/volume1/photo /mnt/ds/photo nfs rsize=8192,nosuid,wsize=8192,soft,vers=4.0,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s 0 0
192.168.1.2:/volume1/public /mnt/ds/public nfs nosuid,rsize=8192,wsize=8192,soft,vers=4.0,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s 0 0
192.168.1.2:/volume1/scans /mnt/ds/scans nfs nosuid,wsize=8192,rsize=8192,soft,vers=4.0,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s 0 0
192.168.1.2:/volume1/video /mnt/ds/video nfs rsize=8192,nosuid,wsize=8192,soft,vers=4.0,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s 0 0
...

This results in these entries when running "mount":
Code: Select all
[nick@HAL9000 ~]$ mount
...
systemd-1 on /mnt/ds/backups type autofs (rw,relatime,fd=55,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=4219)
systemd-1 on /mnt/ds/homes type autofs (rw,relatime,fd=56,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=4222)
systemd-1 on /mnt/ds/music type autofs (rw,relatime,fd=57,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=4225)
systemd-1 on /mnt/ds/photo type autofs (rw,relatime,fd=58,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=4228)
systemd-1 on /mnt/ds/public type autofs (rw,relatime,fd=59,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=4231)
systemd-1 on /mnt/ds/scans type autofs (rw,relatime,fd=60,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=4234)
systemd-1 on /mnt/ds/video type autofs (rw,relatime,fd=61,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=4237)
...

No real mounts, actually, but when I access any of the paths it seems to really mount the share as an entry appears in "mount", eg:
Code: Select all
[nick@HAL9000 ~]$ cat /etc/fstab
...
192.168.1.2:/volume1/video on /mnt/ds/video type nfs4 (rw,nosuid,relatime,vers=4.0,rsize=8192,wsize=8192,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.4,local_lock=none,addr=192.168.1.2)
192.168.1.2:/volume1/scans on /mnt/ds/scans type nfs4 (rw,nosuid,relatime,vers=4.0,rsize=8192,wsize=8192,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.4,local_lock=none,addr=192.168.1.2)
192.168.1.2:/volume1/public on /mnt/ds/public type nfs4 (rw,nosuid,relatime,vers=4.0,rsize=8192,wsize=8192,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.4,local_lock=none,addr=192.168.1.2)
192.168.1.2:/volume1/backups on /mnt/ds/backups type nfs4 (rw,nosuid,relatime,vers=4.0,rsize=8192,wsize=8192,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.4,local_lock=none,addr=192.168.1.2)
192.168.1.2:/volume1/photo on /mnt/ds/photo type nfs4 (rw,nosuid,relatime,vers=4.0,rsize=8192,wsize=8192,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.4,local_lock=none,addr=192.168.1.2)
192.168.1.2:/volume1/homes on /mnt/ds/homes type nfs4 (rw,nosuid,relatime,vers=4.0,rsize=8192,wsize=8192,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.4,local_lock=none,addr=192.168.1.2)
192.168.1.2:/volume1/music on /mnt/ds/music type nfs4 (rw,nosuid,relatime,vers=4.0,rsize=8192,wsize=8192,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.4,local_lock=none,addr=192.168.1.2)
...


So this seams to fix my problem but is this approach ok?
nickdegraeve
 
Posts: 51
Joined: Mar 18th, '12, 08:01

Re: NFS shares not mounted at boot

Postby doktor5000 » Mar 30th, '24, 19:43

nickdegraeve wrote:Is "_netdev" a valid option?
I checked the man page of nfs and "_netdev" is never mentioned.

Yes, although that's a generic option for all mounts. Check the man page of systemd.mount: https://www.freedesktop.org/software/sy ... ml#_netdev

nickdegraeve wrote:So this seams to fix my problem but is this approach ok?

Well you'd have to decide that. If it works for you and you don't need this during boot or for login then this is totally OK.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18013
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: NFS shares not mounted at boot

Postby nickdegraeve » Apr 1st, '24, 09:17

"_netdev" just doesn't work.
Do you have an idea why it might be so?

I did some more trying and just adding "x-systemd.automount" seems to do the job better dan with the additional "x-systemd" options as the shares were mounted at boot instead of on access.

From the link you provided:
Normally the file system type is used to determine if a mount is a "network mount", i.e. if it should only be started after the network is available. Using this option overrides this detection and specifies that the mount requires network.

I would have thought that the file system type being "nfs" woulds qualify it as a network mount and therefore the option wouldn't be unnecessary.
nickdegraeve
 
Posts: 51
Joined: Mar 18th, '12, 08:01

Re: NFS shares not mounted at boot

Postby nickdegraeve » Apr 1st, '24, 10:28

After some more testing:
I did some more trying and just adding "x-systemd.automount" seems to do the job better dan with the additional "x-systemd" options as the shares were mounted at boot instead of on access.

It didn't mount all of them. And those that didn't, had to be explicitly mounted.

So until I get "_netdev" working "x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s" seems to be the way to go.
nickdegraeve
 
Posts: 51
Joined: Mar 18th, '12, 08:01

Re: NFS shares not mounted at boot

Postby doktor5000 » Apr 1st, '24, 14:54

Unrelated note, when I use _netdev I always used to put this at the beginning of the options, but that should not matter.

nickdegraeve wrote:"_netdev" just doesn't work.
Do you have an idea why it might be so?

This usually depends on what handles your network, and how your network is setup. Some more details would be helpful,
like do you use the default net_applet or networkmanager to manage your network connections, and can you show the ifcfg files for that ?
Code: Select all
ll /etc/sysconfig/network-scripts/ifcfg-*
for i in /etc/sysconfig/network-scripts/ifcfg-*; do echo "$i ======================" ; cat $i; done


Also complete journal logs from a fresh boot might be helpful
Code: Select all
journalctl -ab > /tmp/journal.log
as root after a fresh boot, and then later attach /tmp/journal.log here.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18013
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: NFS shares not mounted at boot

Postby nickdegraeve » Apr 3rd, '24, 19:29

Code: Select all
[root@HAL9000 /home/nick]# ll /etc/sysconfig/network-scripts/ifcfg-*
-rwxr-xr-x 1 root root 257 Feb 15 13:58 /etc/sysconfig/network-scripts/ifcfg-enp4s0*
-rw-r--r-- 1 root root 254 Aug 19  2023 /etc/sysconfig/network-scripts/ifcfg-lo
-rw-r--r-- 1 root root  42 Apr  1 09:24 /etc/sysconfig/network-scripts/ifcfg-vboxnet0
-rwx------ 1 root root 431 Apr  1 09:33 /etc/sysconfig/network-scripts/ifcfg-wlo1*


Code: Select all
[root@HAL9000 /home/nick]# for i in /etc/sysconfig/network-scripts/ifcfg-*; do echo "$i ======================" ; cat $i; done
/etc/sysconfig/network-scripts/ifcfg-enp4s0 ======================
DEVICE=enp4s0
BOOTPROTO=static
IPADDR=192.168.1.4
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=yes
DNS1=208.67.222.222
DNS2=208.67.222.220
DOMAIN=google
RESOLV_MODS=no
IPV6INIT=yes
IPV6TO4INIT=no
ACCOUNTING=no
/etc/sysconfig/network-scripts/ifcfg-lo ======================
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
/etc/sysconfig/network-scripts/ifcfg-vboxnet0 ======================
DEVICE=vboxnet0
BOOTPROTO=dhcp
ONBOOT=yes
/etc/sysconfig/network-scripts/ifcfg-wlo1 ======================
DEVICE=wlo1
BOOTPROTO=static
IPADDR=192.168.1.5
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
ONBOOT=yes
METRIC=35
MII_NOT_SUPPORTED=no
USERCTL=no
DNS1=208.67.222.222
DNS2=208.67.222.220
RESOLV_MODS=no
WIRELESS_MODE=Managed
WIRELESS_ESSID=THUIS2
WIRELESS_ENC_KEY=s:<redacted>
WIRELESS_WPA_DRIVER=wext
WIRELESS_WPA_REASSOCIATE=no
KEY_MGMT=WPA-PSK
WPA_PSK=<redacted>
IPV6INIT=yes
IPV6TO4INIT=no
ACCOUNTING=no

The attached log is from boot to login.
I didn't ran mount yet and in the fstab I put "_netdev" at the start, just to be sure.
Attachments
journal.log
journalctl -ab > /tmp/journal.log
(168.74 KiB) Downloaded 518 times
nickdegraeve
 
Posts: 51
Joined: Mar 18th, '12, 08:01

Re: NFS shares not mounted at boot

Postby doktor5000 » Apr 3rd, '24, 22:12

Still the same issue. As you use the legacy network setup, there's not much that can be done about this, boot does not wait long enough for the network to be actually up before trying the mounts.
You can either keep your previous fstab entries with x-systemd.requires=network-online.target or you could switch to networkmanager which provides NetworkManager-wait-online.service:
https://wiki.mageia.org/en/Switching_to_networkmanager

Apr 03 19:14:17 HAL9000 mount[2296]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/public on /mnt/ds/public
Apr 03 19:14:17 HAL9000 mount[2285]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/backups on /mnt/ds/backups
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-public.mount: Mount process exited, code=exited, status=32/n/a
Apr 03 19:14:17 HAL9000 mount[2293]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/photo on /mnt/ds/photo
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-public.mount: Failed with result 'exit-code'.
Apr 03 19:14:17 HAL9000 systemd[1]: Failed to mount mnt-ds-public.mount.
Apr 03 19:14:17 HAL9000 systemd[1]: Dependency failed for remote-fs.target.
Apr 03 19:14:17 HAL9000 mount[2290]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/music on /mnt/ds/music
Apr 03 19:14:17 HAL9000 systemd[1]: remote-fs.target: Job remote-fs.target/start failed with result 'dependency'.
Apr 03 19:14:17 HAL9000 mount[2302]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/video on /mnt/ds/video
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-backups.mount: Mount process exited, code=exited, status=32/n/a
Apr 03 19:14:17 HAL9000 mount[2299]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/scans on /mnt/ds/scans
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-backups.mount: Failed with result 'exit-code'.
Apr 03 19:14:17 HAL9000 systemd[1]: Failed to mount mnt-ds-backups.mount.
Apr 03 19:14:17 HAL9000 mount[2288]: mount.nfs: Network is unreachable for 192.168.1.2:/volume1/homes on /mnt/ds/homes
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-music.mount: Mount process exited, code=exited, status=32/n/a
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-music.mount: Failed with result 'exit-code'.
Apr 03 19:14:17 HAL9000 systemd[1]: Failed to mount mnt-ds-music.mount.
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-photo.mount: Mount process exited, code=exited, status=32/n/a

Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-photo.mount: Failed with result 'exit-code'.
Apr 03 19:14:17 HAL9000 systemd[1]: Failed to mount mnt-ds-photo.mount.
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-scans.mount: Mount process exited, code=exited, status=32/n/a
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-scans.mount: Failed with result 'exit-code'.
Apr 03 19:14:17 HAL9000 systemd[1]: Failed to mount mnt-ds-scans.mount.
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-homes.mount: Mount process exited, code=exited, status=32/n/a
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-homes.mount: Failed with result 'exit-code'.
Apr 03 19:14:17 HAL9000 systemd[1]: Failed to mount mnt-ds-homes.mount.
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-video.mount: Mount process exited, code=exited, status=32/n/a
Apr 03 19:14:17 HAL9000 systemd[1]: mnt-ds-video.mount: Failed with result 'exit-code'.
Apr 03 19:14:17 HAL9000 systemd[1]: Failed to mount mnt-ds-video.mount.


Also check e.g. https://systemd.io/NETWORK_ONLINE/ for some more context information.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18013
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: NFS shares not mounted at boot

Postby nickdegraeve » Apr 4th, '24, 06:50

Ok, I'll try to switch.
The legacy network setup seems to be the default in Mageia 9, though, as my setup is a fresh install on my new pc some months ago.
I'll report back later.
Thanks.
nickdegraeve
 
Posts: 51
Joined: Mar 18th, '12, 08:01

Re: NFS shares not mounted at boot

Postby nickdegraeve » Apr 5th, '24, 06:47

Ok, switching to NetworkManager did the trick.
And, I learned that it was because I did a net install that I was still running the legacy network.
Thanks for the help.
nickdegraeve
 
Posts: 51
Joined: Mar 18th, '12, 08:01

Re: [SOLVED] NFS shares not mounted at boot

Postby nickdegraeve » Apr 5th, '24, 06:54

TL;DR;
- Add "_netdev" to the mount options in /etc/fstab (https://www.freedesktop.org/software/sy ... ml#_netdev)
- Switch to NetworkManager (https://wiki.mageia.org/en/Switching_to_networkmanager)
nickdegraeve
 
Posts: 51
Joined: Mar 18th, '12, 08:01

Re: [SOLVED] NFS shares not mounted at boot

Postby morgano » Apr 5th, '24, 11:14

Thank you for that summary - I think many can find it handy :)

Makes me think we need a wiki page on NFS.

And maybe our drak tool to connect to a NFS share should be updated to use this.
At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1475
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron