You are not logged in.

#1 2019-11-12 22:28:39

indianahorst
Member
Registered: 2008-08-23
Posts: 127

Timeout Option for CIFS Mount

Hello everybody,

I have looked through a lot of webpages, forums and so on, but couldn't find a real solution.

So, my question is:

How can I configure a CIFS mount in fstab in a way that it doesn't freeze my filemanager (Thunar under XFCE) when the Samba server isn't reachable?

I have experimented with Systemd Automount, but as far as I understand it, it just waits (x-systemd.device-timeout=10s) at boot or it unmounts a mountpoint when idle (x-systemd.idle-timeout=60s).
For example, two versions of my configurations in /etc/fstab:

First, without Systemd Automount:

//ip-address/data   /media/data    cifs    noauto,nofail,user,rw,iocharset=utf8,vers=3.0,_netdev        0 0

Second, with Automount:

//ip-address/data     /media/data    cifs    x-systemd.automount,x-systemd.device-timeout=30,x-systemd.idle-timeout=60,retry=0,rw,iocharset=utf8,vers=3.0,soft    0 0

Both variants freeze Thunar, when the server isn't reachable.

So, how can I configure a timeout to avoid that?
Thanks in advance!

Offline

#2 2019-11-13 08:02:46

seth
Member
Registered: 2012-09-03
Posts: 50,005

Re: Timeout Option for CIFS Mount

"soft" is supposed to be the default anyway. Does the problem go beyond thunar? Ie. do you get hangs when trying to "ls /media/data"?

Also please clarify the scenario. Is it that the server is temporarily unreachable (because it's windows and just BSOD'd :-P) or is it because you're not in the same subnet? (Eg. this is a server at your home, but you're at at your office now and therefore the server isn't reachable?)
In the latter case: what's the actual IP (if it's a private range like 192.168.0.0/16, you're not exposing anything secret here) and what's the output of "ip a" and "ip r" at the failing location?

Offline

#3 2019-11-13 20:03:21

indianahorst
Member
Registered: 2008-08-23
Posts: 127

Re: Timeout Option for CIFS Mount

seth wrote:

"soft" is supposed to be the default anyway. Does the problem go beyond thunar? Ie. do you get hangs when trying to "ls /media/data"?

Yes it goes beyond Thunar. ls hangs, so it seems to be not only a Thunar problem.

seth wrote:

Also please clarify the scenario. Is it that the server is temporarily unreachable (because it's windows and just BSOD'd :-P) or is it because you're not in the same subnet? (Eg. this is a server at your home, but you're at at your office now and therefore the server isn't reachable?)

It's the first scenario. The server is temporarily unreachable (it's not Windows, Samba runs on LibreELEC on a Raspberry Pi 4 and an external harddrive and sometimes it is switched off, while the client (Thinkpad) is still running).

seth wrote:

In the latter case: what's the actual IP (if it's a private range like 192.168.0.0/16, you're not exposing anything secret here) and what's the output of "ip a" and "ip r" at the failing location?

Yes, everything is in a provate IP range (192.168.1.0/24).

Offline

#4 2019-11-13 20:19:06

seth
Member
Registered: 2012-09-03
Posts: 50,005

Re: Timeout Option for CIFS Mount

You could try to lower the echo_interval (defaults to 60 seconds) to increase the detection of the broken connection.

Offline

#5 2019-12-04 01:09:55

Stratoblaster
Member
From: Florida
Registered: 2018-12-04
Posts: 58

Re: Timeout Option for CIFS Mount

Typically I use this format - it helps with a faster reboot also.

defaults,nofail,x-systemd.device-timeout=10ms    0    0


Supercalifragilisticexpialidocious

Offline

Board footer

Powered by FluxBB