LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   autofs and mounting cifs mounts on centos 6.3 (https://www.linuxquestions.org/questions/linux-server-73/autofs-and-mounting-cifs-mounts-on-centos-6-3-a-4175577218/)

thllgo 04-11-2016 05:11 PM

autofs and mounting cifs mounts on centos 6.3
 
I am trying to automount cifs mounts on centos 6.3 and failing. I have the following
/etc/auto.master
Quote:

/mnt/cifs /etc/auto.smb --timeout=60
+auto.master
/etc/auto.smb original unedited
/etc/auto.smb.fileshare {where fileshare is the name of the windows file server}
Quote:

username=user
password=password
where username and password are the username and password for the credentials of the file server. I restart autofs and nada, no error no nothing. No error in /var/log/messages or any other file that I can find.
If I run the command
Quote:

mount //fileserver/Software -o username=username -t cifs /mnt/cifs
it asks for a password, I enter it the mount works. What am I missing in the autofs portion?
Any help will be appreciated.
Thank you

Doug G 04-11-2016 08:00 PM

When I set up a couple windows automounts, I created a credentials file for the windows login. Verified it worked manually, then change the autofs.smb file to use the credentials file. I used /mnt/subdir mount points for the automounted shares.

Worked for me from Fedora 23 system.

John VV 04-11-2016 09:06 PM

please double check the version
Cent only supports the current minor version
that is CentOS 6.7

you are 5 minor versions and 3 years out of date
and missing 3 years of security updates

Code:

cat /etc/redhat-release
needs to state CentOS 6.7

thllgo 04-12-2016 09:04 AM

I found a centos 7 system to work on. Currently I have
/etc/auto.master
Quote:

/mnt/cifs /etc/auto.fileprint01 --timeout=60
/etc/auto.fileprint01
Quote:

soft -fstype=cifs,rw,noperm,credentials=/etc/auto.smb.fileprint01 ://fileprint01/Software
/etc/auto.smb.fileprint01
Quote:

username=uname
password=pword
where uname and pword are the username and password of a valid account

tshikose 04-12-2016 09:35 AM

Hi,

So now after restarting the autofs service by systemctl restart autofs, and then ls -l /mnt/cifs/soft, what is the output?

thllgo 04-12-2016 10:08 AM

The /mnt/cifs dir is empty. I get nothing, not even an error.

thllgo 04-13-2016 01:39 PM

Yea I figured it out. In the auto.master file I had to add the option "--ghost". Everything I read said it was optional, for me it was not.

Doug G 04-13-2016 06:08 PM

Happy to hear you got it resolved. I'm gonna check my configuration and see if I used --ghost. The documentation for automount is "sparse" :)

Just looked, yep, I used that option too. I don't even know what it does.

thllgo 04-14-2016 12:49 PM

according to what I've read is that it is supposed to make a place holder even when the share is not mounted. So if you are mounting a share to /mnt/Share --ghost will keep a dir for Share whereas if you don't use the option /mnt/Share will only exist when the share is mounted otherwise there will only be /mnt without a Share dir.

Doug G 04-14-2016 03:13 PM

Thanks for the info!

thllgo 04-14-2016 04:15 PM

no problem


All times are GMT -5. The time now is 03:16 PM.