I have a laptop with debian that I am mainly using on my home wifi. To access some network disks, I have a few lines like these in /etc/fstab:
disk:/media/vol0 /home/disk0 nfs4 noauto,x-systemd.automount,x-systemd.device-timeout=10
disk:/media/vol1 /home/disk1 nfs4 noauto,x-systemd.automount,x-systemd.device-timeout=10
This works great when accessing, when I access the /home/disk1 directory on the laptop, the disk is being mounted. The problem is when shutting down, then my wifi is a user connection so it goes down when my user is logged out. Then the nfs unmount will hang. It used to be a 90 second delay which was a bit annoying, but acceptable, but after the last debian upgrade, it seems to be a infinite delay to retry to umount a nfs-disk when the server is unavailable. (I have so far not been waiting for a long time, this is according to the messages during shutdown) This means that I have to force shutdown the machine and I never get a clean umount of / among other problems.
The root cause for this problem is of course that I have a user defined network and a system defined nfs mount. I (think I) know how to define the wifi connection as a system service, but that would make other things difficult, so I wonder:
- Is there a setting to make the nfs a user defined mount so it would be taken down before the wifi connection goes down? or,
- How can I set the timeout for the umount?
(When typing this question, I realized that a possible workaround would be to set a idle time out on the nfs mount so it automatically unmounts when it is idle for a while, but for this to work, the timeout would have to be so short that it manages to unmount in the timespan from the last process accessing the mount is killed to the wifi is taken down, so maybe not)
,_netdev
option to inform systemd about this is a network dependent mount.