NFS Automount not working

Issues related to configuring your network
Post Reply
Mimicafe
Posts: 4
Joined: 2013/08/08 16:41:26

NFS Automount not working

Post by Mimicafe » 2013/08/08 16:56:51

Hi
I configured nfs client and server on 6.4, and I am able to manually mount the shared filesystem, but automount (mount via autofs) isn't working and I don't know what is wrong.

Aug 8 17:28:35 lamp automount[3253]: lookup(file): failed to read included master map auto.master

I noticed above error in /var/log/mesages, but I could not get helpful information on the web.




NFS Server

[mimi@centoshack ~]$ sudo exportfs -a -v
exporting 192.168.18.101:/data


NFS Cient

[mimi@lamp etc]$ sudo mount -t nfs 192.168.18.102:/data /mnt/data
[mimi@lamp etc]$ls -l /mnt/data/
total 4
-rw-r--r--. 1 root root 0 Aug 7 23:27 createdonhack
drwxr-xr-x. 2 root root 4096 Aug 8 17:52 Music
[mimi@lamp etc]$



Autofs conf
=====
[mimi@lamp etc]$ sudo cat auto.master
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given.
#
/net -hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master

/mnt/data /etc/auto.data

[mimi@lamp etc]$


[mimi@lamp etc]$ sudo cat auto.data
mydata -rw,soft,intr,rsize=8192,wsize=8192 192.168.18.102:/data
[mimi@lamp etc]$


Aug 8 17:28:02 lamp kernel: nfsd: last server has exited, flushing export cache
Aug 8 17:28:02 lamp rpc.mountd[2637]: Caught signal 15, un-registering and exiting.
Aug 8 17:28:02 lamp rpc.mountd[3152]: Version 1.2.3 starting
Aug 8 17:28:03 lamp kernel: NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
Aug 8 17:28:03 lamp kernel: NFSD: starting 90-second grace perio

Aug 8 17:28:02 lamp kernel: nfsd: last server has exited, flushing export cache
Aug 8 17:28:02 lamp rpc.mountd[2637]: Caught signal 15, un-registering and exiting.
Aug 8 17:28:02 lamp rpc.mountd[3152]: Version 1.2.3 starting
Aug 8 17:28:03 lamp kernel: NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
Aug 8 17:28:03 lamp kernel: NFSD: starting 90-second grace period
Aug 8 17:28:31 lamp automount[2538]: umounted indirect mount /mnt/nfs
Aug 8 17:28:31 lamp automount[2538]: shut down path /mnt/nfs
Aug 8 17:28:31 lamp automount[2538]: autofs stopped
Aug 8 17:28:35 lamp automount[3253]: Starting automounter version 5.0.5-74.el6_4, master map auto.master
Aug 8 17:28:35 lamp automount[3253]: using kernel protocol version 5.02
Aug 8 17:28:35 lamp automount[3253]: lookup(file): failed to read included master map auto.master
Aug 8 17:28:35 lamp automount[3253]: mounted indirect on /misc with timeout 300, freq 75 seconds
Aug 8 17:28:35 lamp automount[3253]: mounted indirect on /net with timeout 300, freq 75 seconds
Aug 8 17:28:35 lamp automount[3253]: mounted indirect on /mnt/data with timeout 300, freq 75 second

User avatar
toracat
Forum Moderator
Posts: 7284
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

NFS Automount not working

Post by toracat » 2013/08/08 17:34:21

Try starting with a simple set up like the following:

auto.master:

# /net -hosts
# +auto.master
/misc /etc/auto.misc

auto.misc:

mydata -fstype=nfs 192.168.18.102:/data

Restart autofs and try 'ls /misc/mydata' and see if it gets automounted.

Mimicafe
Posts: 4
Joined: 2013/08/08 16:41:26

Re: NFS Automount not working

Post by Mimicafe » 2013/08/08 19:27:58

The simple config and test pointed me to what I was doing wrong. I now run "ls -l /mnt/data/mydata" as oppose to "ls -l /mnt/data/" and voila, it worked. Sometimes simple mistakes can cost a lot.

I still see the error below in /var/log/messages although my setup is now working. Anyone knows what this means?

Aug 8 20:11:01 lamp automount[6033]: lookup(file): failed to read included master map auto.master

Thanks

Mimi

User avatar
toracat
Forum Moderator
Posts: 7284
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: NFS Automount not working

Post by toracat » 2013/08/08 20:01:57

Comment out the line +auto.master if you are not using NIS.

lensman3
Posts: 18
Joined: 2013/08/10 02:08:52
Location: Centennial, Colorado USA

Re: NFS Automount not working

Post by lensman3 » 2013/08/10 17:55:48

My auto.misc looks like ->

music -fstype=nfs4,rw 192.168.x00.11:/u1

The server is a fedora 18.

Post Reply