You are not logged in.
Hi,
I cannot get my machine to automatically mount my NFS share on boot. It used to work until recently (probably up to my last update).
For troubleshooting, I made sure I followed the instructions from the wiki. The fstab contains the following mount line:
192.168.1.6:/mnt/pool0 /mnt/RAID5 nfs auto,x-systemd.automount,x-systemd.device-timeout=10,x-systemd.requires=network.target,timeo=14 0 0After startup, the automount service is failed:
[causa-prima@arch ~]$ systemctl status mnt-RAID5.automount
● mnt-RAID5.automount
Loaded: loaded (/etc/fstab; generated; vendor preset: disabled)
Active: failed (Result: mount-start-limit-hit) since Thu 2017-09-07 16:30:17 CEST; 17s ago
Where: /mnt/RAID5
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
[causa-prima@arch ~]$ systemctl status mnt-RAID5.mount
● mnt-RAID5.mount - /mnt/RAID5
Loaded: loaded (/etc/fstab; generated; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-09-07 16:30:16 CEST; 21s ago
Where: /mnt/RAID5
What: 192.168.1.6:/mnt/pool0
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
Process: 831 ExecMount=/usr/bin/mount 192.168.1.6:/mnt/pool0 /mnt/RAID5 -t nfs -o x-systemd.automount,x-systemd.requires=network.target,timeo=14 (code=exited, status=32)I also enabled NetworkManager-wait-online.service,
[causa-prima@arch ~]$ systemctl status NetworkManager-wait-online.service
● NetworkManager-wait-online.service - Network Manager Wait Online
Loaded: loaded (/usr/lib/systemd/system/NetworkManager-wait-online.service; enabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:nm-online(1)and added x-systemd.requires=network.target to the fstab line, but still the nfs share is not automatically mounted. Restarting the service after login works just fine, and everything is mounted correctly:
[causa-prima@arch ~]$ systemctl restart mnt-RAID5.automount
[causa-prima@arch ~]$ systemctl status mnt-RAID5.automount
● mnt-RAID5.automount
Loaded: loaded (/etc/fstab; generated; vendor preset: disabled)
Active: active (waiting) since Thu 2017-09-07 16:31:05 CEST; 5s ago
Where: /mnt/RAID5
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
[causa-prima@arch ~]$ systemctl status mnt-RAID5.mount
● mnt-RAID5.mount - /mnt/RAID5
Loaded: loaded (/etc/fstab; generated; vendor preset: disabled)
Active: active (mounted) since Thu 2017-09-07 16:31:15 CEST; 756ms ago
Where: /mnt/RAID5
What: 192.168.1.6:/mnt/pool0
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
Process: 1333 ExecMount=/usr/bin/mount 192.168.1.6:/mnt/pool0 /mnt/RAID5 -t nfs -o x-systemd.automount,x-systemd.requires=network.target,timeo=14 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/mnt-RAID5.mountI have no idea what else to enable / change to get it working again, and I don't know why it broke in the first place. I never had troubles with mounting on startup before, just some occasional trouble with automatic unmounting on shutdown. Any hint on how to enable automounting again would be very greatly appreciated!
Last edited by causa-prima (2017-10-29 04:58:34)
Offline
I have the same issue. Not really sure what changed exactly.
Stuff at boot is requesting access to things in /mnt/whatever. Automount tries to mount it due to the request. And then systemd is setting the mount service to 'failed' forever because of too many failed mount requests (5 in 10seconds or something).
Normally I use x-systemd.automount to avoid that since it should just come up magically when its working again. But it's just failing at boot then being set to failed forever.
Also network-online.target is being set as 'started' as soon as NetworkManager.service is up (before DHCP). This seems deliberate since the NetworkManager-wait-online.service is passing a flag in to do just that, but it seems like that isn't the intended meaning of the network-online.
One possible fix is to change /NetworkManager-wait-online to actually require the interface to actually be up (currently it just waits for NetworkManager to start even without DHCP). This has the effect of making your system wait for your mounts to come online. It also kind of defeats the point of automount.
Remove the -s in /usr/lib/systemd/system/NetworkManager-wait-online.service
ExecStart=/usr/bin/nm-online -q --timeout=30Another possibility is to try and change the start-limit.
StartLimitBurst, StartLimitInterval are mentioned for service files. But the mount service files are automatically generated and I don't think there is any template to mess with (seems hardcoded in the binary). it might be possible to add a vendor override file for each of the mounts in the right place (ie /etc/systemd/system/mnt-storage4.mount.d/override.conf).
EDIT: Can confirm that adding the following to /etc/systemd/system/path-to-mnt.mount.d/override.conf seems to fix it:
[Unit]
StartLimitIntervalSec=0You will need to add one for each nfs/cifs mount though.
Last edited by H3g3m0n (2017-09-13 06:04:09)
Offline
Sorry I didn't find the time to answer earlier. Thanks for your workaround, I also can confirm that it works perfectly! The question remains whether this is some bug that should be reported somewhere.
Offline