16.04 CIFS "Host is down" but they are not

I have my CIFS setup in fstab and they are working as they are supposed to on boot. They mount as they should and work for a while. Out of nowhere it seems (could be after unlocking machine etc) I get "Host is down" error trying to access it. I have multiple and they are all down. They are also shared from the same server. At this time i check on a windows computer and an outdated 14.04 machine and they are up and functioning as they are supposed to. After clicking around on the shares in nautilus and getting repeat errors they will just start working again. To access a share that is "down" takes about 2-3min of randomly clicking different mounts and going back to the first one when automagically it shows the data in the mount point.

I do not have this problem on 14.04 machines that have not been updated in a while. All of those machines are fully functional and the CIFS never go "down". On 16.04 they were not a problem until more recently.

I have made sure to update every other day and have cleaned old linux headers (in hind sight i probably should have reverted). I do this because im begging for a fix to just appear but its been weeks of battling CIFS mounts without any solution.


Solution 1:

After many tests adding vers=1.0 in the mount line seems to fix the problem. The mount works now on Ubuntu 17.10 like it did for years on older Ubuntu releases.

Solution 2:

I'm facing the same problem. It seems it has something to do with newest Kernel versions and samba.

I've managed to solve this by adding vers=2.0 at mount commands (or a the end of each fstab line)

Solution 3:

Others have already hinted at the solution, but it may be worth shortly explaining the reason.

mount.cifs in Ubuntu 16.04 uses the SMB1 protocol by default.

In later versions of mount.cifs, the default SMB version is 2.1 or 3.0.

Current Windows servers do not support the SMB 1.0 protocol anymore, unless specifically configured in their registry to accept it. So by default, they reject connections from clients using the SMB1 protocol. Which leads to the misleading message "Host is down".

But some older systems (most often NASes) do not support protocols 2.1 or 3.

The solution is to tell mount.cifs to use the right protocol to connect to your server, using the vers= option. For example, to connect to a Windows 10 machine:

mount -t cifs ... -o vers=3.0,...

or to an old NAS from Ubuntu 18.04 or later :

mount -t cifs ... -o vers=1.0,...

From man mount.cifs (in Ubuntu 16.04):

   vers=
       SMB protocol version. Allowed values are:

       ·   1.0 - The classic CIFS/SMBv1 protocol. This is the default.

       ·   2.0 - The SMBv2.002 protocol. This was initially introduced in
           Windows Vista Service Pack 1, and Windows Server 2008. Note
           that the initial release version of Windows Vista spoke a
           slightly different dialect (2.000) that is not supported.

       ·   2.1 - The SMBv2.1 protocol that was introduced in Microsoft
           Windows 7 and Windows Server 2008R2.

       ·   3.0 - The SMBv3.0 protocol that was introduced in Microsoft
           Windows 8 and Windows Server 2012.

       Note too that while this option governs the protocol version used,
       not all features of each version are available.

If you define your mount in /etc/fstab, it might look something like this:

//server/share  /mnt/share  cifs  defaults,vers=3.0,...your_other_options...,nofail,x-systemd.device-timeout=15 0 0

Solution 4:

I've faced the same problem myself, I wanted to auto mount using the method found in the Ubuntu wiki (https://wiki.ubuntu.com/MountWindowsSharesPermanently) although I've got the same problem as stated above: mount error(112): Host is down

The thing is what helped me is adding vers=3.0 at the and of the options:

//servername/sharename /media/windowMBsshare cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8,sec=ntlm,vers=3.0 0 0

So it seems it only works now if you bypass SMB1 and use other specified one, SMB3 worked for me so I haven't tried anything else.

I've used a local account on the windows machine not one with outlook.com domain name as I've read something that this could cause conflicts too.