AutoFS Mystery …

Home » CentOS » AutoFS Mystery …
CentOS 9 Comments

I need a second pair of eyes here, please. I have a CentOS 6.6 server
(let’s call it ‘S1″) that has a Samba share on it that is currently working. We can mount that drive on our Windows work stations and transfer/delete from it just fine. It’s setup as a “guest” config so no user specific passwords or any other restrictions like that.

I’m trying to setup another server (“S2”), also CentOS 6.6 with autofs to mount that same share when it needs to. For some reason I can’t seem to get it to work. I get no error message anywhere, no indication of a failure, nothing.

So on S2 I have:
$ cat /etc/auto.master
/misc /etc/auto.misc
/mnt/trex /etc/auto.trex
/net -hosts

$ cat /etc/auto.trex trex -fstype=cifs,rw,noperm,credentials=/etc/cifs-credentials-trex

The file /etc/cifs-credentials-trex is present with the correct credentials, and the server also has in its /etc/hosts file an entry that tells it what IP that ‘bigrip’ machine is.

Having done all of that and restarting the service (or even the whole machine) does not auto mount that share and I can’t figure out why. I’ve completely disabled iptables on both machines, no luck. When I issue an smbclient command, I get this:

$ smbclient -L bigrip -Uguest Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23-14.el6_6]

Sharename Type Comment
——— —- —–

9 thoughts on - AutoFS Mystery …

  • If I’ve read the files correctly, you might need to use /mnt/trex/trex for autofs to work. Can you try:

    /mnt /etc/auto.trex

    and see if that works as you intended?


  • Nope, that completely takes over ‘/mnt’ and everything else that’s in there becomes invisible. However, I do believe you’re on to something here. Looking back at the other, working setup, I do realize now that I did the same, where the path was ‘/mnt/‘ and the autofs mounts are within that, so they became ‘/mnt//‘ – so thanks for that hint. I’ll go fiddle with it.

  • Right, I use something other than /mnt for my autofs.

    Another thing you may want to consider is use of ‘direct map’ instead of ‘indirect map’. If I remember correctly, it works well with cifs mounts, too.


  • I’m sure you can find nice documentations that explain the two mapping methods. Just briefly, With ‘direct map’, you can mount virtually at any point because it uses absolute paths. In some situations (like mounting directly under /), ‘direct map’ is the only option for autofs.

    In /etc/auto.master, you add a line similar to:

    /- /etc/

    And in /etc/, you may have:

    /mounthere -fstype=cifs,rw,blah ://machine/share


  • Ok, I think I discovered an issue. It may be a “feature” but this is what has bitten me now. After making the above fixes with the proper paths, it still wasn’t working. When I do an smbclient query, it gave me all the details indicating the share is there and available. however, autofs was still failing. When I tried a manual mount on the client, I would get:

    $ mount -t cifs //bigrip/trex /mnt/trex -o user=guest Retrying with upper case share name mount error(6): No such device or address Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

    And on the server side I see this:
    CIFS VFS: cifs_mount failed w/return code = -6

    On a hunch, I decided to make a small change on the server side. The samba configuration is set up with a server name and several aliases for the various shares, so the staff here can go to \\\ and
    \\\ and have different access control, different files, and all that fun, but it’s all on the same physical machine. The path I was trying to mount is on one of those aliases. So I made that change on the server, exporting the share on the real server name and now suddenly it’s working. I can mount it with no problems, and autofs is working. When I
    switched it back to using the server alias, it fails.

    Interestingly, the Windows clients mounting this share, using the server alias, are working just fine. But for some reason that does not work when I
    try it from a CentOS machine.

  • Akemi Yagi wrote:

    Is considered direct mounting, or indirect?

    One thing to note, Ashley – we have that set up, but you *can’t* ll
    /project, it’s not there until you look for it by name, say, ll
    /project/joesproj, and *then* it’s there.