12

I tried this command:

mount -t cifs //server/share/directory /mnt/directory -o credentials=/path/to/cifs.credentials --verbose 

Response is:

mount.cifs kernel mount options: ip=<IP of server>,unc=\\server \share,user=<username>,prefixpath=directory,pass=******** mount error(2): No such file or directory Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) 

However, if I try the same command without the prefix path:

mount -t cifs //server/share /mnt/directory -o credentials=/path/to/cifs.credentials --verbose 

It works, and I can access /mnt/directory/directory.

I get the same error if I specify the prefixpath explicitely in the options, i.e.:

mount -t cifs //server/share /mnt/directory -o credentials=/path/to/cifs.credentials,prefixpath=directory --verbose 

Additional info:

  • I am able to connect to the desired path using smbclient //server/share -U username -W domain -D directory
  • mount.cifs version: 5.5
  • Debian kernel 3.2.0-4-amd64
  • I am able to connect on another machine using mount.cifs version 4.5 on Debian kernel 2.6.32-5-amd64

Any ideas why the prefixpath seems to cause a problem? This same path had been working recently; I suspect an update to a package on the Linux side or a Windows update is behind the new behavior.

3
  • Is this to a NAS? When you say you try "without the prefix path" the command looks the same. Is that a typo? Commented Nov 26, 2014 at 3:42
  • It's to a NetApp SAN. You're right, that was a typo--I've corrected it. Commented Dec 1, 2014 at 21:10
  • A NetApp support tech had be provide a packet trace, where they discovered that mount.cifs is sending //server/share//directory rather than //server/share/directory. This appears to be the cause of the problem (though not a solution). Commented Jul 29, 2015 at 18:50

2 Answers 2

8

Finally found a workaround for this issue that works with our NetApp. If you don't need DFS try mounting with the nodfs option.

mount -t cifs //server/share/directory /mnt/directory -ocredentials=/path/to/cifs.credentials,nodfs 
1
  • We also use netapp. Thanks for this workaround, it saved my afternoon. Commented Jan 18, 2017 at 16:38
1

I also had this error mount error(2): No such file or directory while mounting (also a NetApp SAN).

Adding the nodfs mount option worked. However, I was missing the keyutils package. Once installed, mounting worked as expected without nodfs.

On Ubuntu :

sudo apt install keyutils 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.