Linux Automount question

Hello,

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
mokkanAsked:
Who is Participating?
 
farzanjCommented:
I suppose this is RHEL5, right?

Here is a complete description
http://www.cyberciti.biz/faq/centos-fedora-rhel-nfs-v4-configuration/
0
 
mokkanAuthor Commented:
Yes, rhel5.
0
 
farzanjCommented:
The above one would work or there is this Quick Howto
http://linuxwave.blogspot.com/2008/08/nfs-howto-for-centos-5.html

CentOS5 is same as RHEL5
0
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
0
 
farzanjCommented:
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
0
 
PilouteCommented:
>> 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...

Cheers,
P
0
 
PilouteCommented:
0
 
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?
0
 
farzanjCommented:
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.
0
 
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
0
 
mokkanAuthor Commented:
Basically, how do I display nfsserver in /net directory
0
 
mokkanAuthor Commented:
I found it. you need to add the following line in /etc/auto.master

/net            -hosts          -nosuid

0
 
farzanjCommented:
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  
0
 
mokkanAuthor Commented:
Thank you for all of your inputs.
0
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.