The command mount.cifs is found not being able to run in a gentoo system with systemd

ae429-1105 etc # mount -t cifs //file.abc.edu.au/user /home/directory/path -o credentials=/etc/user,rw,iocharset=utf8,file_mode=0777,dir_mode=0777
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

It has been confirmed that the existence and accessibility of the mountpoint /home/directory/path and credential file /etc/user. Also the relevant modules and services has been enabled, i.e.,

 ae429-1105 etc # lsmod |egrep 'fuse|cifs'
 fuse                   72589  5 
 cifs                  312131  0


ae429-1105 etc # systemctl -t service -a |grep Samba
nmbd.service                         loaded active   running Samba NetBIOS                     name server
smbd.service                         loaded active   running Samba SMB/CIFS     server
winbindd.service                     loaded inactive dead    Samba Winbind daemon

This problem has been identified by many users, e.g. one example . ALSO NOTE that the same command executed in my Ubuntu/debian system is able to mount successfully.

Other information in the problematic machine:

ae429-1105 etc # mount.cifs --version
mount.cifs version: 6.1

the version of mount.cifs installed in debian/ubuntu is 6.0

  • /home/directory/path is certain to exist in the Gentoo environment? Strange that you don't mention that as this is the obvious first question which arises. – Hauke Laging Mar 21 '14 at 0:58
  • Yes, I have confirmed the existence and accessibility of the mount point /home/directory/path. – Chenming Zhang Mar 21 '14 at 1:00
  • You should add this information to the question so that other readers need not read the comments to get it. – Hauke Laging Mar 21 '14 at 1:08

You might need to provide the vers= option to the mount command to force version 3.0 if you're trying to mount a share from a newer version of Windows. One of our fileservers was recently upgraded to 2012R2 and that's when my mount stopped working. Setting it to vers=3.0 fixed the issue. Like most Samba/CIFS errors the "No such file or directory" message isn't much help.

As an example:

# mount -t cifs //win2012r2/someshare -o cred=/home/foo/.cifs_user, vers=3.0 /mnt/tmp

..where I have my domain, username and password contained in the .cifs_user file.

Apparently, smbmount uses a newer version of the SMB protocol by default since it worked without issue or any special options.

Notice below that the default protocol version is 1.0.

From the mount.cifs man page:

           SMB protocol version. Allowed values are:

           ·   1.0 - The classic CIFS/SMBv1 protocol. This is the default.

           ·   2.0 - The SMBv2.002 protocol. This was initially introduced in Windows Vista Service Pack 1, and
               Windows Server 2008. Note that the initial release version of Windows Vista spoke a slightly
               different dialect (2.000) that is not supported.

           ·   2.1 - The SMBv2.1 protocol that was introduced in Microsoft Windows 7 and Windows Server 2008R2.

           ·   3.0 - The SMBv3.0 protocol that was introduced in Microsoft Windows 8 and Windows Server 2012.
  • I had a similar problem with the "nounix" flag which must not be supported in v1.0. Changing to v2.0 (the most recent available for me) fixed the problem. Also file permissions are more sensible with vers=2.0 (755 instead of 777) – cxrodgers Aug 12 '17 at 21:10

You might need to change the sec parameter: this setting made it work on my setup:

mount.cifs ... -o sec=ntlm

Relevant extract of man mount.cifs:

sec= Security mode. Allowed values are:

   ·   none - attempt to connection as a null user (no name)

   ·   krb5 - Use Kerberos version 5 authentication

   ·   krb5i - Use Kerberos authentication and forcibly enable packet signing

   ·   ntlm - Use NTLM password hashing

   ·   ntlmi - Use NTLM password hashing and force packet signing

   ·   ntlmv2 - Use NTLMv2 password hashing

   ·   ntlmv2i - Use NTLMv2 password hashing and force packet signing

   ·   ntlmssp - Use NTLMv2 password hashing encapsulated in Raw NTLMSSP message

   ·   ntlmsspi - Use NTLMv2 password hashing encapsulated in Raw NTLMSSP message,
and force packet signing

   The default in mainline kernel versions prior to v3.8 was sec=ntlm. In v3.8, the
default was changed to sec=ntlmssp.

   If the server requires signing during protocol negotiation, then it may be
enabled automatically. Packet signing may also be enabled automatically if it's
enabled in /proc/fs/cifs/SecurityFlags.

I was running into this same "mount error(2): No such file or directory" error using mount.cifs on a CentOS 7 VM. I never determined exactly why the error was being generated when using the default ntlm security (and the variants), but I did discover that using Kerberos authentication worked around the problem. So my final working command line looked like this:

mount.cifs -v -o domain=MYCODOMAIN,sec=krb5 //winserver/sharename /mnt/mymountpoint

whereas this command that gave the "no such file or directory" error was:

mount.cifs -v -o username=myusername,domain=MYCODOMAIN //winserver/sharename /mnt/mymountpoint

To use Kerberos, I installed "krb5-workstation" package and configured it.


Can you use nodfs option? ie for your -o options input pass the input as below.

-o credentials=/etc/user,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,nodfs

i.e appended ,nodfs

It worked for me.


I ran into this on Ubuntu 18.04. The problem was I needed the keyutils package to do Kerberos authentication (sec=krb5 mount option), which was not installed along with cifs-utils (which provided mount.cifs). I'm not sure if the package name is the same on Gentoo or not. (Thanks to https://forum.zentyal.org/index.php?topic=18601.0 for the solution.)


Try this please add $ like this //winserver/sharename$

mount.cifs -v -o username=myusername,domain=MYCODOMAIN //winserver/sharename$ /mnt/mymountpoint


Try to install the package keyutils:

sudo apt-get install keyutils

Not sure exactly why this helps, maybe someone else has an answer here. But at least it did the trick for me: with keyutils the cifs mount worked just fine.

  • Please add some information on how this would resolve the problem stated in the question. What does this package do, and how does it figure into the problem raised by the OP? – Haxiel Mar 20 at 15:03
  • Good question. I am not sure how the package keyutils helps. In my case at least this is what did the trick. After install of keyutils, my cifs mount worked just fine, whereas before I did get the error message "mount error(2): No such file or directory", just as in the OP. – Klaus Mar 24 at 11:41

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.