32

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.

DevinM
  • 433
  • 1
  • 4
  • 6

5 Answers5

38

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.

Eliah Kagan
  • 119,640
18

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)

8

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
mivk
  • 5,811
7

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.

1

For Windows 9x (95, 98, ME) servers, in addition to vers=1.0, you need to add the servern[etbiosname] switch when invoking mount:

mount -t cifs -o vers=1.0,sec=none,user=alice,file_mode=0644,servern=SERVER //server/share /mount/point

The value should be the NetBIOS name of the remote server.

Here's the documentation of the switch:

       servernetbiosname=arg
              Specify  the  server netbios name (RFC1001 name) to use when at‐
              tempting to setup a  session  to  the  server.  Although  rarely
              needed  for mounting to newer servers, this option is needed for
              mounting to some older servers (such as OS/2 or Windows  98  and
              Windows  ME)  since  when  connecting over port 139 they, unlike
              most newer servers, do not support  a  default  server  name.  A
              server  name  can be up to 15 characters long and is usually up‐
              percased.

NetBIOS over TCP/IP is documented in RFC 1001 and 1002.

Bass
  • 151