LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Automount fails with "key "xxxx" not found in map source(s)" (https://www.linuxquestions.org/questions/linux-general-1/automount-fails-with-key-xxxx-not-found-in-map-source-s-4175514301/)

thealmightyos 08-11-2014 11:10 PM

Automount fails with "key "xxxx" not found in map source(s)"
 
Seems CentOS7 keeps me in the forums today.

I am attempting to automount my windows share using this howto. I am following method four.

I got my systems so I can easily mount the shares via the command line using ether the ip or the hostname of the windows system. The command I am using is:
Code:

mount -t cifs //host.name/share -o username=username,password=password /network/pc
Problem is, that is my gamming pc and I do not leave that on. So when it goes down for a night my server is going to pitch a fit. So, I want to automount so it is only mounted when the server requests data from it.

I followed the instructions in the howto exactly (well, I changed names and such where needed). Here is my auto.network file that my auto.master points to:

Code:

host.name        -fstype=cifs,rw,noperm,user=user,pass=pass ://host.name/share
Now, this all looks correct going by what is shown in the howto. However, when I try to browse to my share nothing is there. I check /var/log/messages and the error I get is the one in the title:
Code:

automount[2084]: key "Users" not found in map source(s).
(Users was the directory I attempted to cd to)

I googled the error message but came up with a wide array of issues. I don't know where to begin. Any suggestions?

thealmightyos 08-12-2014 05:53 PM

Ok. So I think I solved it. I had a few things wrong

First, anyone who has this problem should turn on logging in /etc/sysconfig/autofs. I just changed it from off to verbose and that gave me a lot more information to go on in log\messages.

1. I was pointing towards my media hard drive, D$ (:\\host.name\D$)
autofs DOES NOT like the $. It was trying to mount \\host.name\D and failing. So I created an actual share for the drive "media" and that solved that

2. The second part of this is sort of weird and I do not understand it yet, but autofs is very picky about where you mount to. I wanted to mount to /network/host.name. The plan was to have automounts for all the networked pc's. I created the directories and that is what I listed in the /etc/auto.master. However, when I removed host.name and made it just /network, the mount worked flawlessly and even mounted the host.name directory as I originally intended. :scratch:

All in all, the automount feature needs more documentation. I am quite proficient with the googles but could not come up usable information and examples of syntax that helped at all. It was turning the logging on and trial and error that got this working and I am concerned about the next share I am going to set up.

I would not exactly call this "solved", more like "issue resolved for the time being". But I will hit the button anyway. Hope this helps someone

MadeInGermany 12-03-2015 10:26 AM

The /net/ trick
 
Just saw this, and think it needs an explanation.
For 2. ensure your /etc/auto.master has
Code:

/net            -hosts          -nosuid,nobrowse
The mount point for this map is /net
The -hosts (special option) means:
a reference to /net/HOSTNAME will issue a
Code:

showmount -e HOSTNAME
and display whatever it finds as /net/HOSTNAME/exportpath
Knowing the server names in your network you can access everything they export through /net/


All times are GMT -5. The time now is 11:57 AM.