I would like to auto-unmount a samba (cifs) share before suspend or shutdown my computer.
The problem is that when a reboot or shutdown or suspend is done, and if a cifs share is open, the network access is terminated before the CIFS filesystems are unmounted. This produces a huge delay as each share must wait for it's umount request to time out (1.5 minute). Moreover the computer actually can't close this connection, because if I check active smb connections with sudo smbstatus
in my NAS, the computer shown as an active client.
A possible solution is executing a script before suspend / restart / shutdown, but I'm not sure that it would be the best way to solve this problem, because it's an inconvenient workaround.
Are there any easy solution (for example an fstab option, like _netdev
) ?