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=,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
  • 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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.