Linux Force Default Mount CIFS Version to 3.0

3

I'm running Ubuntu Server 16.04.3 LTS 64-Bit with cifs-utils installed, as a VM, on a VMWare ESXi 6.5 hyper-visor.

I have a regular network share setup on Windows Server 2016.

The objective is to utilize Veeam Linux Agent to Backup this Linux VM to a Windows Share via CIFS.

The Problem:

When I am configuring Veeam to use CIFS, (viewing the logs) veeam is executing this command to connect to the network share:

mount -t cifs -o username=MyUsername,password=*,rw,soft //MyServerIP/MyShare /tmp/veeam/MyServerIPMyShare

It gives me the error: mount error(112): Host is down.

When I run the command manually, it does the same thing.

However when I run the command like this:

mount -t cifs -o vers=3.0,username=MyUsername,password=*,rw,soft //MyServerIP/MyShare /tmp/veeam/MyServerIPMyShare

It mounts without issue same if I use 2.0 as well.

The problem is, there is no way to force version 3.0 in Veeam. So, I need to be able to force this in Linux some how.

I've seen others have ran into this issue as well, but no solution was presented.

I've attempted the following (based on what I found):

Added the following lines to /etc/samba/smb.conf

server min protocol = SMB2
server max protocol = SMB3
client min protocol = SMB2
client max protocol = SMB3
min protocol = SMB2
max protocol = SMB3
client ipc min protocol = SMB2

I mixed and matched variations with reboots, to no avail.

Steven4x4

Posted 2018-02-23T17:32:16.677

Reputation: 31

Answers

2

For a given mount.cifs version, I don't know of a way other than adding vers=3.0 to the command line (or to /etc/fstab). The mount.cifs driver ignores smb.conf. Historically it seems mount.cifs could not auto-negotiate, and simply tried one protocol version - 1.0 until July 2017, and 3.0 after that. (July 2017 being the date of the code change to cifs 4.13, not that earlier versions looked at that date at runtime!) From September 2017 it looks like it can auto-negotiate, defaulting to 2.1 or later (whatever the highest is that the server can offer).

Thus if you can upgrade your version of cifs, you should be able to get a different resulting protocol version even without specifying one explicitly.

Here is the mapping of mount.cifs, smb.conf and Windows protocol versions:
vers=3.0 is SMB3 i.e. Windows 8, Windows Server 2012
vers=2.1 is SMB2_10 i.e. Windows 7, Windows Server 2008 R2
vers=2.0 is SMB2_02 i.e. Vista SP1, Windows Server 2008
vers=1.0 is NT1 i.e. Windows 95, NT 4.0

stevek_mcc

Posted 2018-02-23T17:32:16.677

Reputation: 640

2Importantly, "upgrade your version of cifs" means installing a new kernel version with a new cifs.ko module – not the cifs-utils package or the mount.cifs tool. (Also don't forget vers=3.1 for Windows 10.) – user1686 – 2018-05-17T13:50:37.823

@grawity - Also importantly, you need the matching mount.cifs to go with your new kernel. Without it, you can't pass in some of the new options (or new values for existing options). – Michael Kohne – 2018-10-22T17:58:15.540