Score:0

How to auto-unmount a cifs share if I shut down / reboot / suspend my computer?

cn flag

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) ?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.