You are not logged in.

#1 2022-03-15 20:04:44

Dieter
Member
From: Germany
Registered: 2005-10-13
Posts: 140

Unmount NAS before Wifi is disconnected

Hello,

I'm using a NAS (nfs access) with my laptop with systemd and mount / automount units, accessed via Wifi. Start and use is ok, but I have a problem with the shutdown:
The Wifi ist stopped before the NAS is unmounted and so the unmount times out (90 seconds waiting ...).

How can I setup the NAS mount / automount units for systemd so that the NAS is unmounted before the Wifi is disconnected?

Wifi is configured with iwd, NetworkManager is not installed.

I tried it this way, but the 90 seconds pause at shutdown still occurs:

/etc/systemd/system/mnt-NAS.mount:

[Unit]
Description=NAS mount
After=network-online.target

[Mount]
What=192.168.178.50:/export/Raspi-NAS
Where=/mnt/NAS
Type=nfs
Options=rw

[Install]
WantedBy=multi-user.target

/etc/systemd/system/mnt-NAS.automount:

[Unit]
Description=NAS automount

[Automount]
Where=/mnt/NAS

[Install]
WantedBy=multi-user.target

Offline

#2 2022-03-16 12:03:37

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Unmount NAS before Wifi is disconnected

Have you tried a custom script as described at https://wiki.archlinux.org/title/NFS#Au … t_handling ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB