Autofs doesn't work
I have setup autofs to mount nfs automatically every I want to use it.
Here are the basic configurations I made in files: [root@server2 /]# cat /etc/auto.master | grep -v ^# /misc /etc/auto.misc /shares /etc/auto.shares /net -hosts +auto.master [root@server2 /]# cat /etc/auto.shares | grep -v ^# nfs -fstype=nfs 192.168.122.1:/nfs [root@server2 /]# cat /etc/sysconfig/autofs | grep -v ^# TIMEOUT=300 BROWSE_MODE="no" MOUNT_NFS_DEFAULT_PROTOCOL=4 USE_MISC_DEVICE="yes" [root@server2 /]# ll /shares/ total 0 [root@server2 /]# ll /shares/ total 0 [root@server2 /]# ll /shares/ total 0 [root@server2 /]# ll /shares/ total 0 [root@server2 /]# ll /shares/ total 0 I did reboot the system, but it doesnt automatically mount on /shares directory, but if I manually mount nfs, it works! [root@server2 /]# mount -t nfs 192.168.122.1:/nfs /shares/ [root@server2 /]# ll /shares/ total 0 -rw-r--r--. 1 root root 0 Sep 17 2012 selinux.txt Any idea whats wrong with autofs? |
i am still semi new to autofs, but from what i have seen it will not auto mount on boot, that is what fstab is for. when you goto view the directory (mount points) autofs will mount the shares and you will have access to them.
|
Quote:
|
ahh, now that would be a problem. i had to play with it on the cifs mounts i put in. let met post what i have for my cifs:
Code:
cat /etc/auto.master |
It didn't help much with
[root@server2 /]# cat /etc/auto.master | grep -v ^# /misc /etc/auto.misc /shares /etc/auto.shares --timeout=600 --ghost /net -hosts +auto.master |
Doesn't anyone know how to fix the issue?
|
autofs can use lazy mounting ( -hosts) ; this means it only actually mounts the share when you access the content eg cd into it.
https://access.redhat.com/knowledge/...ig-autofs.html |
Quote:
Here is the different linux box I tried on: [root@rhel6 ~]# cat /etc/auto.master | grep -v ^# /misc /etc/auto.misc /net -hosts +auto.master /shares /etc/auto.shares [root@rhel6 ~]# cat /etc/auto.shares | grep -v ^# nfs -fstype=nfs 172.16.1.23:/nfs [root@rhel6 ~]# cat /etc/sysconfig/autofs | grep -v ^# TIMEOUT=300 BROWSE_MODE="no" MOUNT_NFS_DEFAULT_PROTOCOL=4 USE_MISC_DEVICE="yes" FIREWALL>>>>>>>>>>>>>> [root@rhel6 ~]# cat /etc/sysconfig/iptables | grep -v ^# *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5905 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT I hope this gives you more details. |
Okay here is the deal and I tell you whats going on after playing wit different system all day.
I have CentOS6.3 box running with two KVM known as server2 and tester1. I have one more box, but that has RHEL6.1. So when I use autofs in RHEL box, it works! Only trouble I had was that I wasn't doing cd nfs inside shares folder. When I did "cd nfs" it automatically mounted nfs drive in rhel box. Now, on KVM's. SO as I said KVM's are running on Centos6.3 box. NFS server is running on main box (CentOS6.3) and I am trying to run autofs on server2, but I cannot get it to mount. Both are on same network with 192.168.122.0/24. Both can ping each other, but when I configure autofs and try to use the mount_point, but doesn't work. Here is what happens: [root@server2 /]# cd share/ [root@server2 share]# cd nfs -bash: cd: nfs: No such file or directory [root@server2 share]# |
Here is the log from messages
Sep 17 04:02:55 server2 automount[1800]: lookup_read_master: lookup(nisplus): couldn't locate nis+ table auto.master Sep 17 04:03:11 server2 automount[1800]: key "-" not found in map source(s). Sep 17 04:05:22 server2 automount[1800]: umount_autofs_indirect: ask umount returned busy /share Sep 17 04:05:26 server2 automount[1865]: lookup_read_master: lookup(nisplus): couldn't locate nis+ table auto.master Sep 17 04:05:31 server2 automount[1865]: key "-" not found in map source(s). |
All times are GMT -5. The time now is 11:36 PM. |