DNS prior to mount of NFS shares during startup

General support questions
Post Reply
lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

DNS prior to mount of NFS shares during startup

Post by lightman47 » 2019/08/21 16:32:36

I have an issue on only one machine where nfs mounts via fstab are failing (at least initially). The log complains of failing to resolve the server name in with the fail entries.

Code: Select all

Aug 19 02:57:55 wcandace NetworkManager[1458]: <info>  [1566197875.0880] manager: startup complete
Aug 19 02:57:55 wcandace systemd: Started Network Manager Wait Online.
Aug 19 02:57:55 wcandace systemd: Reached target Network is Online.
Aug 19 02:57:55 wcandace systemd: Mounting /mnt/wlinux.2tb1...
Aug 19 02:57:55 wcandace systemd: Mounting /mnt/wlinux.4tb1...
Aug 19 02:57:55 wcandace systemd: Started MachineStartupLogging.
Aug 19 02:57:55 wcandace mount: mount.nfs: Failed to resolve server wlinux: Name or service not known
Aug 19 02:57:55 wcandace mount: mount.nfs: Operation already in progress
Aug 19 02:57:55 wcandace mount: mount.nfs: Failed to resolve server wlinux: Name or service not known
Aug 19 02:57:55 wcandace mount: mount.nfs: Operation already in progress
Aug 19 02:57:55 wcandace systemd: Mounting /mnt/wlinux.4tb2...
Aug 19 02:57:55 wcandace systemd: Starting System Logging Service...
Aug 19 02:57:55 wcandace systemd: Starting Notify NFS peers of a restart...
Aug 19 02:57:55 wcandace systemd: Started Berkeley Open Infrastructure Network Computing Client.
Aug 19 02:57:55 wcandace mount: mount.nfs: Failed to resolve server wlinux: Name or service not known
Aug 19 02:57:55 wcandace mount: mount.nfs: Operation already in progress
Aug 19 02:57:55 wcandace sm-notify[1833]: Version 1.3.0 starting
Aug 19 02:57:55 wcandace systemd: mnt-wlinux.2tb1.mount mount process exited, code=exited status=32
Aug 19 02:57:55 wcandace systemd: Failed to mount /mnt/wlinux.2tb1.
Aug 19 02:57:55 wcandace systemd: Dependency failed for Remote File Systems.
Aug 19 02:57:55 wcandace systemd: Job remote-fs.target/start failed with result 'dependency'.
Aug 19 02:57:55 wcandace systemd: Unit mnt-wlinux.2tb1.mount entered failed state.
Aug 19 02:57:55 wcandace systemd: mnt-wlinux.4tb1.mount mount process exited, code=exited status=32
Aug 19 02:57:55 wcandace systemd: Failed to mount /mnt/wlinux.4tb1.
Aug 19 02:57:55 wcandace systemd: Unit mnt-wlinux.4tb1.mount entered failed state.
Aug 19 02:57:55 wcandace systemd: mnt-wlinux.4tb2.mount mount process exited, code=exited status=32
Aug 19 02:57:55 wcandace systemd: Failed to mount /mnt/wlinux.4tb2.
Aug 19 02:57:55 wcandace systemd: Unit mnt-wlinux.4tb2.mount entered failed state.
Aug 19 02:57:55 wcandace systemd: Started Notify NFS peers of a restart.
I might mention that often the mounts eventually 'mount' without intervention, but sometimes not.

My question: Where do I start looking to find out why resolution is failing on only this one machine - which uses the same fstab entires and DHCP server as all the others.

Thank you.

P.S. Weelky/fully updated CentOS 7
Last edited by lightman47 on 2019/08/21 19:05:55, edited 1 time in total.

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: DNS prior to mount of NFS shares during startup

Post by aks » 2019/08/21 19:01:26

Yeah systemd's wait-until-network-online thing (Wants= stanza), is a bit crappy. What defines network up? Link? IP address? DNS resolution? Can get to the default gateway?
Perhaps insert your own bit to check all the stuff is there before starting the auto mounters (seems crappy but udev does emit "events" - perhaps not as granular as we'd like). At a guess use FQDN (seems unlikely)?

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: DNS prior to mount of NFS shares during startup

Post by pjsr2 » 2019/08/21 21:05:54

I prefer to do the NFS mounts via autofs, not through fstab. Using autofs is much more resilient in case your NFS server is temporarily unavailable.

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: DNS prior to mount of NFS shares during startup

Post by jlehtone » 2019/08/22 07:02:53

pjsr2 wrote:
2019/08/21 21:05:54
I prefer to do the NFS mounts via autofs, not through fstab.
+1
Mount of automounts is delayed to first access. That gives network.target some more time.

If you don't like autofs, there is also systemd.automount. Add option
x-systemd.automount to fstab mounts and systemd will generate units for them.

Autofs does also umount unused volumes, decreasing dependencies between machines.


For the "hard fstab mounts" there is mount option (man mount):
_netdev
The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).
Not sure whether you already had that.

Network startup is affected by "real life"; DHCP and DNS depend on response time of other machines.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: DNS prior to mount of NFS shares during startup

Post by lightman47 » 2019/08/25 14:08:09

Thanks - will be looking into autofs this week and will likely try it.

I may wind up wiping and starting over on a new drive. I keep getting the feeling (number of reasons/quirks) that the "image" is somehow corrupt; there's a 15-30 second pause while loading /boot, BOINC doesn't idle-down after setting it to less CPUs and percentage, this mounting issue, and a few others. I don't believe it's infected by any means but it behaves strangely at times - certainly very different from the other 5 CentOS 7 machines. I've run memtest on it a few times and it always comes up clean. Besides, I have a clean install down to an hour or two via scripts I've written and tweaked over the last couple years.

Thank you again, I appreciate the help.

Post Reply