-1

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.

auto.direct:

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

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: /-

source(s):

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

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

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 ://10.0.10.10/Data
automount[4151]: parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds ://10.10.10.10/Data
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("://10.10.10.10/Data") -> ://10.10.10.10/Data
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=://10.10.10.10/Data
automount[4151]: sun_mount: parse(sun): mounting root /data, mountpoint /data, what //10.10.10.10/Data, fstype cifs, options nfsvers=3,rw,noperm,sec=ntlm,soft,credentials=/etc/data_mnt.creds
automount[4151]: do_mount: //10.10.10.10/Data /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 //10.10.10.10/Data /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 – Satanicpuppy Sep 15 '17 at 18:33
2

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.