NFS unmount (over wireless network) causing shutdown delay

Yes it (unfortunately) is tricky.

Try

pharazon:/raid /mnt/raid nfs users,noauto,nofail,async,noatime,_netdev,x-systemd.automount,x-systemd.device-timeout=10s,x-systemd.mount-timeout=10s,retry=1,x-systemd.idle-timeout=1min 0 0

Hints:

  • noauto is required for “on-demand” mounting (so it doesn’t automount on boot (as root))
  • user or users is needed so it can be mounted/unmounted as non-root user
  • nofail is needed so it doesn’t complain and wait endlessly while booting (and if not reachable)
  • retry=1 is needed so you don’t have to wait shy of 7 days for retries (its default is 10000 minutes)
  • _netdev implies x-systemd.requires=network-online.target
  • async allows mem caching and is faster; for immediate syncing use sync instead (safer but slower)

For the behaviour of this suggestion, read Automount NFS share on access, again.