I am struggling to mount a remote CIFS directory on a Ubuntu system at work. The remote folder appears to be working just fine from my Windows 8.1 session (also at work).
I could not get normal mounting to work:
$ sudo mount -v -t cifs //1.2.3.4/network ~/z -o username=malat,domain=MY,uid=$(id -u),gid=$(id -g),iocharset=utf8
Password for malat@//1.2.3.4/network: *********
mount.cifs kernel mount options: ip=1.2.3.4,unc=\\1.2.3.4\network,iocharset=utf8,uid=1002,gid=1002,user=mmalaterre,domain=MY,pass=********
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
But I eventually stumble upon this ref:
$ sudo mount -v -t cifs //1.2.3.4/network ~/z -o username=malat,domain=MY,uid=$(id -u),gid=$(id -g),iocharset=utf8,nodfs
Password for malat@//1.2.3.4/network: *********
mount.cifs kernel mount options: ip=1.2.3.4,unc=\\1.2.3.4\network,iocharset=utf8,nodfs,uid=1002,gid=1002,user=malat,domain=MY,pass=********
At least I have something working now:
$ mount | grep network
//1.2.3.4/network on /home/malat/z type cifs (rw,relatime,vers=2.1,cache=strict,username=malat,domain=MY,uid=1002,forceuid,gid=1002,forcegid,addr=1.2.3.4,file_mode=0755,dir_mode=0755,soft,nounix,nodfs,mapposix,rsize=1048576,wsize=1048576,bsize=1048576,echo_interval=60,actimeo=1)
However there seems to be something not working (related to DFS option I guess). Here are the symptoms:
$ cd ~/z
$ ls
folder1 folder2
$ ls folder1
subfolder1
$ ls folder2
ls: cannot access 'folder2': Invalid argument
I can access the folder folder2 just fine from my Windows 8.1 session, so this is not a permission issue. How can I access folder2 from my Linux session ?
Here is the tail of dmesg:
[1927958.534353] CIFS: Attempting to mount //1.2.3.4/network
[1927958.534403] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
[1927960.069018] CIFS VFS: DFS capability contradicts DFS flag
[1927960.375111] CIFS VFS: Autodisabling the use of server inode numbers on new server.
[1927960.375115] CIFS VFS: The server doesn't seem to support them properly or the files might be on different servers (DFS).
[1927960.375117] CIFS VFS: Hardlinks will not be recognized on this mount. Consider mounting with the "noserverino" option to silence this message.
Update: If I add vers=1.0 to the mount command, the symptoms are slightly different:
$ cd ~/z
$ cd folder2
$ ls
subfolder2
$ cd subfolder2/
bash: cd: subfolder2/: Object is remote
For reference:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco
kernel version:
$ uname -rvo
5.0.0-38-generic #41-Ubuntu SMP Tue Dec 3 00:27:35 UTC 2019 GNU/Linux
and
$ cat /etc/request-key.d/cifs.spnego.conf
create cifs.spnego * * /usr/sbin/cifs.upcall %k
Update:
