Linux Automount question


I'm trying to setup autofs and NFS server has r/w permission for our server. Our user is asking to go NFS server, like this

cd /net/nfsservername/opt

How can I setup that?  Thanks in advance
Who is Participating?
I suppose this is RHEL5, right?

Here is a complete description
mokkanAuthor Commented:
Yes, rhel5.
The above one would work or there is this Quick Howto

CentOS5 is same as RHEL5
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

mokkanAuthor Commented:
It is  NFS, I need to setup autofs and when user should be able to cd in to   /net/servername
How to get started:

You need to know the target location that you want to automount.

You need to know the directory where it would automount.

Write these down.  Is it on the same computer or are you importing from remote locations?

Then you should have service autofs present

Please fill these in for me and I would be able to assist you better
>> cd /net/nfsservername/opt <<

This is nothing than a directory he wants you to use for mounting the nfs share.
Create the directory /net/nfsservername/opt, then mount the share into that dir.

For setting up a nfs client/server, just google for one of the MANY examples on the net...

mokkanAuthor Commented:
I remember I used to did this, when we cd into /net/nfsservername  we should be able to see all the directories which are shared by NFS server. Whatever in the /net directory comes dynamically or do we need to create the hostname?
Appears you need NFS server and setup NFS clients.

You would export your directory as nfs share by putting it in /etc/exports file.
vi /etc/exports
/net/nfsservername *(rw,no_root_squash)

At least for now.  It does have security issues though.

Then you would do : service nfs restart

Service portmap should already be running.
service portmap status

Then check your mount point
exportfs -a
showmount -e

This should do the basic NFS server which is what I think you need.
mokkanAuthor Commented:
May be I explained wrongly. I can mount manually and filesystem is mountable, but user needs atuofs  and they want to access like   /net/servername/directory

There is no problem with NFS server.,

/net directory loads dynamically and it is in memory and can't create directory.   Here is the output.

[root@server1 net]# df  -k  .
Filesystem           1K-blocks      Used Available Use% Mounted on
-                            0         0         0   -  /net
[root@server1 net]# mkdir nfsserver1
mkdir: cannot create directory `nfsserver1': No such file or directory
mokkanAuthor Commented:
Basically, how do I display nfsserver in /net directory
mokkanAuthor Commented:
I found it. you need to add the following line in /etc/auto.master

/net            -hosts          -nosuid

So your problem is only the client side.  Correct?

On client do this:
mkdir -m 755 -p /net/nfsserver

Edit this file and make sure every line is commented with #
vi /etc/auto.master

Put this line at the bottom of the file
/net   /etc/auto.misc

vi /etc/auto.misc
nfsserver   -ro,soft,intr       serverIP:/net/servername/directory

service autofs restart  
mokkanAuthor Commented:
Thank you for all of your inputs.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.