6

For some reason I cannot cd into a particular remote directory for which I have access, it fails with:

$ cd Data\ Services/
-bash: cd: Data Services/: Invalid argument

This is how I mounted it:

$ sudo mount -t cifs //big.acme.corp/network/ ~/z -o username=myuser,domain=mydomain,uid=$(id -u),gid=$(id -g),vers=1.0
Password for myuser@//big.acme.corp/network/:  *********

I can access it just fine from my Windows 8 laptop (same username/password).

for reference:

$ ls -ald "Data Services"
drwx--x--x 2 myuser myuser 0 Dec 13 09:21 Data Services

At least on my side it seems this shortcut is seen as a directory:

$ find Data\ Services -type d
Data Services
find: ‘Data Services’: Invalid argument

As such I cannot do much with it:

$ cat Data\ Services
cat: Data Services: Invalid argument

or even

$ hexdump Data\ Services
hexdump: Data Services: Invalid argument
hexdump: all input file arguments failed

As suggested below, I tried again with the noperm:

$ sudo mount -t cifs //big.acme.corp/network/ ~/z -o username=myuser,domain=mydomain,uid=$(id -u),gid=$(id -g),noperm

Which gives me:

$ mount
...
//big.acme.corp/network/ on /home/myuser/z type cifs (rw,relatime,vers=1.0,cache=strict,username=big.acme.corp,domain=mydomain,uid=1002,forceuid,gid=1003,forcegid,addr=10.1.2.3,file_mode=0755,dir_mode=0755,nounix,mapposix,noperm,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)

That did not change anything:

$ strings Data\ Services
strings: Data Services: Invalid argument
malat
  • 2,708
  • 4
  • 27
  • 47
  • 5
    Is the `Data Services` location a windows shortcut? – jesse_b Dec 13 '18 at 14:28
  • yes it is. Do I need something special on the unix side ? – malat Dec 13 '18 at 14:30
  • 6
    Yes, unix/linux cannot follow windows shortcuts. You should be able to open the `data services` file with vi/vim or your editor of choice and see the path to the actual directory. Mount that path instead. – jesse_b Dec 13 '18 at 14:31
  • 1
    @Jesse_b `strings 'Data Services'` often quicker than `vi`/`vim`. – roaima Dec 13 '18 at 14:55
  • OK, so the shortcut is (usefully) being translated as a directory. Can you retry the mount, please, with the `noperm` option. – roaima Dec 13 '18 at 15:21
  • Very strange. I can't reproduce this at all with Windows 2012R2 as the server and Debian 9 (Stretch) on the client. A folder shortcut is seen as a file, not as a directory. 1. Is the File Server running Windows, or is it something specialist (maybe running a variant of SAMBA)? 2. From your Windows client, what does Data Services look like? (Folder? Shortcut? To something else on the same share?) – roaima Dec 14 '18 at 10:21

2 Answers2

0

The actual root issue was with the support of DFS. My version of CIFS was too old. Updating to a newer system did not solve all the issues, but I eventually stumble upon:

Which gave me a more verbose error log I found out that:

[...]
[  687.037593] fs/cifs/dns_resolve.c: dns_resolve_server_name_to_ip: unable to resolve: MYSERV13
[  687.037606] fs/cifs/cifs_dfs_ref.c: cifs_compose_mount_options: Failed to resolve server part of //MYSERV13/network to IP: -2
[...]

Updating my resolve.conf from:

search acme.corp

to:

search acme.corp mydoma01.acme.corp

I was finally able to call mount -t cifs without the 'nodfs' option. The symptoms are no longer an error and simply informative:

$ cd Data Services
CIFS VFS: BAD_NETWORK_NAME: \\MYSERV13\network
[...]

I can finally access the content of Data Services without issue.

In conclusion:

  1. One need some recent cifs-utils package,
  2. Do not use nodfs option
  3. Make sure your resolv.conf is correctly defined

Full thread at:

nodfs reference:

malat
  • 2,708
  • 4
  • 27
  • 47
-1

Try options iocharset=utf8 and vers=1.0 when mounting the share:

mount -t cifs -o iocharset=utf8,vers=1.0 //server/share /path/to/mount

That solved the issue for me.

André R
  • 1
  • 2