Solved

Autofs

Posted on 2014-01-30
7
270 Views
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.
0
Comment
Question by:ittechlab
[X]
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
7 Comments
 

Author Comment

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

Expert Comment

by:Daniel Helgenberger
ID: 39821337
Hello,

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)
0
 

Author Comment

by:ittechlab
ID: 39821453
what is the +auto.master in /etc/auto.master mean?
0
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
LVL 13

Expert Comment

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

Author Comment

by:ittechlab
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
+auto.master
/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?
0
 
LVL 13

Accepted Solution

by:
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.
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39823412
0

Featured Post

Technology Partners: 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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

691 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