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

10 Answers 10


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.
| improve this answer | |
  • 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
  • 4
    Thanks a lot for the solution related to vers= option! It worked for me, only backwards...After upgrading opensuse leap from 42.3 version to 15.1, an fstab entry for mounting a network drive, which worked, stopped working in 15.1. I used the option vers=1.0 and guess what...Probably leap 15.1 uses a newer version of SMB protocol that was not able to find the remote directory. – John Jul 13 '19 at 14:54
  • 1
    Connecting to a share hosted on Windows Server 2003 from Ubuntu 19.04 continually failed for me until I added vers=1.0 to my options list. Thanks! – user8675309 Aug 12 '19 at 21:03
  • It worked for me, EXCEPT: I had to state Version TWO vers=2.0 to mount the samba shares of my 5-year-old NAS system... with 3.0 I got above error. – Frank Nocke Sep 8 '19 at 13:15
  • etc/fstab users: Just put that vers=3.0 (or 2.0...) right and spaceless before your other options, i.e. vers=2.0,guest,uid=1000,iocharset… – Frank Nocke Sep 8 '19 at 13:16

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.

| improve this answer | |
  • thank you! I tried all other suggestions first, but I needed this on fedora30 where I did not need it before – Jens Timmerman Jul 26 '19 at 10:40
  • nodfs worked for me, but so did installing the keyutils package – Max Jun 24 at 9:56

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.)

| improve this answer | |

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.

| improve this answer | |
  • 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 '19 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 '19 at 11:41
  • Duplicate of this other answer – roaima Jul 13 '19 at 15:36

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.

| improve this answer | |

I wanted to add another source of this problem I encountered today. Once you change the user id of a unix user, the smb user created via smbpasswd may not able to authenticate for the samba share anymore resulting in the same error.

So if you changed your unix user id via usermod -u 1000 my_user then you may run into problems. The fix for me was to delete and re-add the smb user afterwards:

smbpasswd -x my_user
smbpasswd -a my_user
| improve this answer | |
  • 1
    While true, how is this related to the original question? – RalfFriedl Jun 16 '19 at 14:12
  • 1
    As I said, if you change the user id of a user, the same error of the original question appears. So if anyone did the same and finds this thread, he or she might find my hint useful. – Ryad Jun 17 '19 at 19:24

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.

| improve this answer | |

Add a $ to the end, like this //winserver/sharename$

mount.cifs -v -o username=myusername,domain=MYCODOMAIN //winserver/sharename$ /mnt/mymountpoint
| improve this answer | |
  • Wow! Any idea what the '$' does? It fixed it for me but no clue to why – Gabriel Fair Jun 28 '19 at 20:22
  • The $ sign is an administrative share in the Windows share context, if activated by the system, a user with administrative rights can access all paths. Example \\MY-SERVER\c$ – Phil795 Oct 25 '19 at 9:31

One solution might be to manually install keyutils since it is not a (hard) dependency of cifs-utils anymore.

Information why keyutils are not installed anymore can be found here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=822841

And a launchpad bug report can be found here: https://bugs.launchpad.net/ubuntu/+source/cifs-utils/+bug/1772148

| improve this answer | |

With me it worked by putting "vers = 1.0" as before -> credentials = / root / .dbx.credentials, vers = 1.0, uid = 1001, gid = 100, rw

| improve this answer | |

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