Lazy unmount of CIFS on connection loss


I am looking for a fstab entry (option) to use on my laptop running Opensuse 13.1 which connects to a CIFS share (NAS). I do not have any issues with mounting the CIFS but unmounting when the connection is lost (i.e. switched off or waking up the laptap remotely). The fstab entry I’m looking for should unmount the CIFS (NAS) share on the laptop when it is no longer available. Ideally it should use the lazy unmount option.

The reason for this is that I am having issues with Libreoffice, Firefox and Dolphin taking long timeout periods (i.e. freezing) when the CIFS (NAS) is no longer available.

Also, where is this default timeout period specified?

Thank you.

It sounds like autofs may suit you better than an fstab entry, as it automatically times out/unmounts when not active.

Here’s a quick tutorial (for nfs, but easily modified to cifs) if interested.

Yes thank you for the reply. I’ve actually always used autofs but considering systemd is taking over I was keen to learn if it could replace autofs for cifs mounts. It seems at this stage it still lacks some basic functionality if the timeout & unmount on connection loss can not be controlled?

If you’re using fstab, you’re actually not using systemd’s native mount.service.
It’s not used that much, the only place I’ve come across today that uses the systemd mount service is VMware configuring shared folders.
But that should be OK as long as you don’t configure anything that conflicts.

For now though I don’t know that any mount method would auto-unmount (if autofs supports this, that’s interesting).