Select Page
This entry has been published on 2016-11-03 and may be out of date.

Last Updated on 2016-11-03.

[:en]If you use a Debian or Ubuntu client system to access a Windows Samba share (CIFS), this works quite easily, basically.

//nas/myshare /mnt/myshare cifs auto,_netdev,username=xx,password=yy,domain=zz 0 0

But what happens if the server is not always available?

I tested the behavior with Debian 7 Wheezy and it was a bit disappointing.

Example: If the SMB share is not available for a few seconds and Debian tries to access it, it stays in this “not available” state for 15 to 20 minutes. In this timespan, you get error messages like

ls: cannot access /mnt/myshare: No such device or address

One workaround might be a cronjob with commands like

umount -l /mnt/myshare && mount -a

but this can only be a solution if e.g. a few single files are copied from time to time.

I also tested mounting via AutoFS, but it takes about the same long time to reconnect as in my example above.

Hopefully, this behavior will be optimized in newer versions.[:]