Skip to main content


Does anyone have a tip how to improve make sure a # / # mount will be reconnected when the connection droped shortly? Or is there some SMB sync option instead, so that I keep a local copy of the files and just sync changes automatically?
# # #

2 people reshared this

see "man mount.cifs" /echo_interval=n

"The reconnection happens at twice the value of the echo_interval set for an unresponsive server. If this option is not given then the default value of 60 seconds is used."

and /CACHE COHERENCY
@f4m8 oh, that is pretty straight forward, so I could change this to 5s or so. Did you ever play with that parameter? I gave a VPN that I use over mobile connection sometimes, so the VPN can drop or be unresponsive.
No, i do not play with those parameters, because i never has those problems. But i know that this is tuneable.
@f4m8 then thanks for the hint. 😉
Does the reconfig solve the reconnect problem?
@f4m8 it got better, but I didn't use the shaky connection again.
hmm... I hope the client is running linux ;)
@Heiko Mischer interesting, AutoFS... never heard of it. Are you using it? I wonder if this mounts on demand, if I understood that correctly?
Autofs is used at all the enterprise clients where I had projects so far (gov, autom, comm).

That HowTo is from me and reflects my current setup.

Mounting filesystems on demand, is ecactly what autofs is made for. 😀
@Heiko Mischer
That HowTo is from me and reflects my current setup.

cool.
Mounting filesystems on demand, is ecactly what autofs is made for.

So on demand and if the connection is not used it will be closed and it will be remounted if needed. Which also means if the connection drops it will be remounted again. That sounds cool and I could use it for another thing I always wanted to get setup. I always wanted to have something similar for an SSH reachable share.
@Heiko Mischer I know, I read that in the Arch wiki. :-D

I found that piece of software very interesting, it seems a bit complex to configure, complex as in "one has to get into it for 2 hours" kind of.
@Heiko Mischer one more question. What happens if the share is not available, will I still see the files and will it produce an error when trying to open a file then?
# stopping services at fileserver
root@mysambaserver:~# service monit stop
root@mysambaserver:~# service smbd stop
# at the client
ls -las /home/myusername/mnt/cifs/mysambaserver.fqdn/share-name/
ls: cannot access '/home/myusername/mnt/cifs/mysamabaserver.fqdn/share-name/': No such file or directory
autofs is getting used in enterprise setups because 'static' mounts will cause a lot of trouble if connections/services will be flapping or even stall/stop the bootup process in case that shares are not available. Because of that, remote filesystems get mountet vie autofs, no matter if cifs/nfs/sshfs/whatever from storage or filers. No exceptions afaik. The mai nbenefit of using autofs is a lot more stability and reliability in operations.
@Heiko Mischer thanks again. I really have to look into this.
@utzer np, you are welcome =)
@Michele Leonardo not that well yet. I should look at autofs, but I don't have time now and it will be bad for weeks to come.