Cannot mount nfs at boot but works manually "Network is unreachable" w/ systemd
Andrew Henderson
Debian 10 box will not mount NFS share from /etc/fstab however executing mount -a mounts said share. I noticed a longer boot time.
# systemctl status home-user-weather-images.mount
● home-user-weather-images.mount - /home/user/weather/images Loaded: loaded (/etc/fstab; enabled-runtime; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2020-10-23 05:36:34 EDT; 1min 1s ago Where: /home/user/weather/images What: 192.168.1.115:/volume1/user/Pictures/NOAA-images/ Docs: man:fstab(5) man:systemd-fstab-generator(8) Oct 23 05:36:34 host systemd[1]: Mounting /home/user/weather/images... Oct 23 05:36:34 host mount[529]: mount.nfs: Network is unreachable Oct 23 05:36:34 host systemd[1]: home-user-weather-images.mount: Mount process exited, code=exited, status=32/n/a Oct 23 05:36:34 host systemd[1]: home-user-weather-images.mount: Failed with result 'exit-code'. Oct 23 05:36:34 host systemd[1]: Failed to mount /home/user/weather/images.Here are fstab entries I've tried:
192.168.1.115:/volume1/user/Pictures/NOAA-images/ /home/user/weather/images nfs ac,user,nfsvers=3,x-systemd.requires=network-online.target,x-systemd.device-timeout=100 0 0 192.168.1.115:/volume1/user/Pictures/NOAA-images/ /home/user/weather/images nfs ac,user,nfsvers=3,_netdev 0 0Also tried, with no success:
systemctl reenable home-user-weather-images.mount systemctl daemon-reloadHere's what the fstab entry's service looks like when using the x-systemd options:
# Automatically generated by systemd-fstab-generator
[Unit]
SourcePath=/etc/fstab
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
Before=remote-fs.target
After=network-online.target
Requires=network-online.target
[Mount]
Where=/home/user/weather/images
What=192.168.1.115:/volume1/user/Pictures/NOAA-images/
Type=nfs
Options=ac,user,nfsvers=3,x-systemd.requires=network-online.target
# dmesg | grep fstab
[ 5.157559] systemd-fstab-generator[260]: x-systemd.device-timeout ignored for 192.168.1.115:/volume1/user/Pictures/NOAA-images/
[ 114.512926] systemd-fstab-generator[1025]: x-systemd.device-timeout ignored for 192.168.1.115:/volume1/user/Pictures/NOAA-images/
[ 470.095851] systemd-fstab-generator[1162]: x-systemd.device-timeout ignored for 192.168.1.115:/volume1/user/Pictures/NOAA-images/
# dmesg | grep nfs
[no output] 2 Answers
I would suggest two actions :
1- Adding the following to the mount options to delay the mount for some moment :
[Mount] Options=late,nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10 0 02- In the section Install add the above so the nfs mount should be mounted before reaching remote-fs target.
[Install] WantedBy=remote-fs.targetSometimes it could be due to DNS resolution, but i am not seeing it here.
EDIT : Since you have an embedded eno0 interface you must declare it on the DHCP configuration with it's correct name reason why you had cannot find eth0 device and sometimes Enabling / Disabling NetworkManager can cause NIC naming confusion.
The file /etc/network/interfaces.d/setup needs to be edited to reflect the proper device from eth0 to eno1.
networking.service also failed (yet somehow networking manages to work). My /etc/default/networking and /etc/dhcp/* files are unmodified. Here is the output from journalctl -u networking.service:
-- Logs begin at Fri 2020-10-23 06:57:31 EDT, end at Fri 2020-10-23 07:00:15 EDT. --
Oct 23 06:57:32 host systemd[1]: Starting Raise network interfaces...
Oct 23 06:57:32 host ifup[425]: Internet Systems Consortium DHCP Client 4.4.1
Oct 23 06:57:32 host ifup[425]: Copyright 2004-2018 Internet Systems Consortium.
Oct 23 06:57:32 host ifup[425]: All rights reserved.
Oct 23 06:57:32 host ifup[425]: For info, please visit
Oct 23 06:57:32 host dhclient[492]: Internet Systems Consortium DHCP Client 4.4.1
Oct 23 06:57:32 host dhclient[492]: Copyright 2004-2018 Internet Systems Consortium.
Oct 23 06:57:32 host dhclient[492]: All rights reserved.
Oct 23 06:57:32 host dhclient[492]: For info, please visit
Oct 23 06:57:32 host dhclient[492]:
Oct 23 06:57:32 host ifup[425]: Cannot find device "eth0"
Oct 23 06:57:32 host dhclient[492]: Failed to get interface index: No such device
Oct 23 06:57:32 host ifup[425]: Failed to get interface index: No such device
Oct 23 06:57:32 host ifup[425]: If you think you have received this message due to a bug rather
Oct 23 06:57:32 host ifup[425]: than a configuration issue please read the section on submitting
Oct 23 06:57:32 host ifup[425]: bugs on either our web page at or in the README file
Oct 23 06:57:32 host ifup[425]: before submitting a bug. These pages explain the proper
Oct 23 06:57:32 host ifup[425]: process and the information we find helpful for debugging.
Oct 23 06:57:32 host ifup[425]: exiting.
Oct 23 06:57:32 host dhclient[492]:
Oct 23 06:57:32 host dhclient[492]: If you think you have received this message due to a bug rather
Oct 23 06:57:32 host dhclient[492]: than a configuration issue please read the section on submitting
Oct 23 06:57:32 host dhclient[492]: bugs on either our web page at or in the README file
Oct 23 06:57:32 host dhclient[492]: before submitting a bug. These pages explain the proper
Oct 23 06:57:32 host dhclient[492]: process and the information we find helpful for debugging.
Oct 23 06:57:32 host dhclient[492]:
Oct 23 06:57:32 host dhclient[492]: exiting.However my ethernet device is eno1:
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 54:b2:03:8d:53:f6 brd ff:ff:ff:ff:ff:ffChecking dmesg again...
# dmesg | grep -i eth
[ 3.170430] e1000e 0000:00:1f.6 eth0: (PCI Express:2.5GT/s:Width x1) 54:b2:03:8d:53:f6
[ 3.170431] e1000e 0000:00:1f.6 eth0: Intel(R) PRO/1000 Network Connection
[ 3.170489] e1000e 0000:00:1f.6 eth0: MAC: 12, PHY: 12, PBA No: FFFFFF-0FF
[ 3.171438] e1000e 0000:00:1f.6 eno1: renamed from eth0Back to Google, looked up why ifup can't find renamed interface. Came across this answer. Checking my /etc/network/interfaces.d/setup:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp... looks like the smoking gun. I never edited this file; this is a week-old install so I don't know why this problem manifested. Edited that, reverted fstab to the non x-systemd entries and a reboot. Now it works.
Before I consider answering my own question it'd be interesting if anyone can explain why this mess happened in the first place then that could be the 'best answer.'