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.

cherdt
  • 1,396
  • 1
  • 10
  • 21
  • Is this to a NAS? When you say you try "without the prefix path" the command looks the same. Is that a typo? – Octopus Nov 26 '14 at 03:42
  • It's to a NetApp SAN. You're right, that was a typo--I've corrected it. – cherdt Dec 01 '14 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). – cherdt Jul 29 '15 at 18:50

2 Answers2

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
dgel
  • 181
  • 1
  • 3
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
Max
  • 143
  • 5