Posted on 2014-01-30
Medium Priority
Last Modified: 2014-02-14
I would like to setup autofs and wondering how its should be implemented. I am bit confused with NFS and AutoFS. Do i need to have NFS to use autofs? how it works?
please also provide me sample configuration as well. I have one server and client which i want to test the result with.
Question by:ittechlab
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Author Comment

ID: 39820959
is AutoFS runs on client side always?
LVL 13

Expert Comment

by:Daniel Helgenberger
ID: 39821337

NFS and AutoFS are two different things: NFS is a special network file system with client/server infrastructure while AutoFS is a client site service for mounting various file systems on runtime access of the mount point.
For instance, lets say you want to mount nfs shares in the /mynfs directory. While you can put an entry in /etc/fstab, this would only be executed at boot time, the server needs to be available at this time, rendering it inaccessible for the client.
As you can imagine, AutoFS is much more robust and therefore always desirable.  

AutoFS consists of several config files. The /etc/auto.master usually defining all the configs you want to load. A sample config could look like this:
$ cat /etc/auto.master
/mynfs      /etc/auto.nfsshares

Open in new window

$ cat /etc/auto.nfsshares
server1   server:/share1
server2   server:/share1
server3   server:/share1

Open in new window

Note, directories server1, server2, server3 would be created in /mynfs of your client.

The above configuration example is very basic, working for < NFSv4. There are countless supported file systems as well as numerous options for more complex needs (like auto - dismount)

Author Comment

ID: 39821453
what is the +auto.master in /etc/auto.master mean?
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

LVL 13

Expert Comment

by:Daniel Helgenberger
ID: 39821517
It just means that any maps defined in auto.master will also be included.

Author Comment

ID: 39822037
[root@server- lvm]# cat /etc/exports
/app/db/data *(rw)

[root@client ~]# cat /etc/auto.master  | grep -v ^#
/misc   /etc/auto.misc
/net    -hosts
/app/db /etc/auto.db

[root@client~]# cat /etc/auto.db
data    IP:/app/db/data

If I login to client as a user and go to /app/db/data, I am not able to write any file.  What should be done to fix the permission issue?

Also on the client side i have another local mount called /app. Will this impact with the above configuration?
LVL 13

Accepted Solution

Daniel Helgenberger earned 1200 total points
ID: 39822255
If I login to client as a user and go to /app/db/data, I am not able to write any file.  What should be done to fix the permission issue?

This is an NFS issue, you should check the /etc/exports of the server and the mount options. Also, NFS permissions are determined by UNIX/POSIX GID/UID of the user trying to access the share. Make sure the groups GID numbers are consistent on both systems.

For instance, if the writable group for the exported share on the server is called nfsusers and has GID 10001, there has to be a group with GID 10001 (called to your liking) on the client and the user accessing the export needs to be a member of that group.
On the server:
groupadd -g 10001 nfsusers
chown -R root:nfsusers /myexports/share1
chmod -R g+w /myexports/share1 

Open in new window

On the client:
groupadd -g 10001 localnfs
usermod -a -G localnfs myuser

Open in new window

Afterwards myuser should be able to write on the mounted NFS share.
A quick but unsafe workaround would be to chmod -R 777 the export on the server.

Also on the client side i have another local mount called /app. Will this impact with the above configuration?
As long as you use autofs on the folder /app/db like in your config above, there will be a problem if the mount on top is not mounted for some reason because the /app/db directory does not exist.
Note, you cannot use mount points below /app/db/ other than autofs.
LVL 13

Expert Comment

ID: 39823412

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question