Posted on 2014-01-30
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
  • 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?
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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 400 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux mount of Windows Shared Now Fails 8 76
Upgraded from Debian 7 to 8.7 and got black screen 20 69
Samba 4, Users Permission, 5 46
Migrating a Linux server to VMware 3 59
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
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 …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

828 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