?
Solved

Linux Automount question

Posted on 2011-05-13
15
Medium Priority
?
421 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:mokkan
  • 7
  • 6
  • 2
15 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 1716 total points
ID: 35754050
I suppose this is RHEL5, right?

Here is a complete description
http://www.cyberciti.biz/faq/centos-fedora-rhel-nfs-v4-configuration/
0
 

Author Comment

by:mokkan
ID: 35754064
Yes, rhel5.
0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 1716 total points
ID: 35754081
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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 

Author Comment

by:mokkan
ID: 35754083
It is  NFS, I need to setup autofs and when user should be able to cd in to   /net/servername
0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 1716 total points
ID: 35754108
0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 1716 total points
ID: 35754134
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
 
LVL 7

Assisted Solution

by:Piloute
Piloute earned 284 total points
ID: 35754144
>> 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
 
LVL 7

Expert Comment

by:Piloute
ID: 35754161
0
 

Author Comment

by:mokkan
ID: 35754239
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
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 1716 total points
ID: 35754305
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
 

Author Comment

by:mokkan
ID: 35754376
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
 

Author Comment

by:mokkan
ID: 35754424
Basically, how do I display nfsserver in /net directory
0
 

Author Comment

by:mokkan
ID: 35754670
I found it. you need to add the following line in /etc/auto.master

/net            -hosts          -nosuid

0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 1716 total points
ID: 35754692
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
 

Author Closing Comment

by:mokkan
ID: 35873316
Thank you for all of your inputs.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

807 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