I had an issue today that dinged my sanity pretty hard, so I'm posting it so some poor bastard who follows in my idiotic footsteps will maybe find solace.

Running Autofs on RHEL7. Basic CIF mount.


/data -fstype=cifs,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds ://

Start autofs, I can see the /data directory, but I cannot access it.

Running automount -m I can see the mount, but it's not working:

autofs dump map information

Mount point: /-


  instance type(s): files
  map: auto.direct

  /data | -fstype=cifs,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds ://

Okay. Step one, run automount -f -v directly and see what the problem is.

Starting automounter version 5.0.7-56.el7, master map auto.master
using kernel protocol version 5.02
mounted direct on /data with timeout 300, freq 75 seconds
attempting to mount entry /data
mounted /data

Okay. The problem is that there is no problem. Are you fricking kidding me?!

Set logging=debug in autofs.conf, restart services, and I get the following:

systemd[1]: Started Automounts filesystems on demand.
automount[4151]: handle_packet: type = 5
automount[4151]: handle_packet_missing_direct: token 2166, name /data, request pid 17539
automount[4151]: attempting to mount entry /data
automount[4151]: lookup_mount: lookup(file): looking up /data
automount[4151]: lookup_mount: lookup(file): /data -> -fstype=cifs,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds ://
automount[4151]: parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds ://
automount[4151]: parse_mount: parse(sun): gathered options: nfsvers=3,fstype=cifs,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds
automount[4151]: parse_mount: parse(sun): dequote("://") -> ://
automount[4151]: parse_mount: parse(sun): core of entry: options=nfsvers=3,fstype=cifs,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds, loc=://
automount[4151]: sun_mount: parse(sun): mounting root /data, mountpoint /data, what //, fstype cifs, options nfsvers=3,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds
automount[4151]: do_mount: // /data type cifs options nfsvers=3,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds using module generic
automount[4151]: mount_mount: mount(generic): calling mkdir_path /data
automount[4151]: mount_mount: mount(generic): calling mount -t cifs -s -o nfsvers=3,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds // /data
automount[4151]: spawn_mount: mtab link detected, passing -n to mount
automount[4151]: >> mount error(22): Invalid argument
automount[4151]: >> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Where in the name of GOD is that nfsvers=3 coming from?

  • I just want to thank you guys for reminding me why I don't participate in Stack anymore Sep 15, 2017 at 18:33

1 Answer 1


So, this has probably been broken in our environment for about 10 years, but we don't use many CIF shares, and autofs on lower versions of RHEL apparently ignores garbage in the mount string if it's clearly garbage (for example trying to set an nfs version on a cif mount), so I was lucky enough to find this one myself.

If you have a disconnect between the behaviour of automount and autofs, the answer is almost certainly in the service configuration file for autofs (/etc/sysconfig/autofs) where I found the following:

OPTIONS="-O nfsvers=3"

which was apparently inserted a decade ago to force compatibility with a NAS we got rid of 5 years ago.

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.