Solved

Autofs

Posted on 2014-01-30
7
262 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
  • 3
  • 3
7 Comments
 

Author Comment

by:ittechlab
Comment Utility
is AutoFS runs on client side always?
0
 
LVL 13

Expert Comment

by:Daniel Helgenberger
Comment Utility
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
Comment Utility
what is the +auto.master in /etc/auto.master mean?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 13

Expert Comment

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

Author Comment

by:ittechlab
Comment Utility
[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
Comment Utility
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
Comment Utility
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now