LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 08-03-2009, 12:42 AM   #1
Savita Eli
LQ Newbie
 
Registered: Jul 2009
Location: St.Louis,MO
Posts: 13

Rep: Reputation: 0
How to automount nfs shares


Hi I want automount nfs shares.

Here are the details:
Server:
---------
Share contents: /dir1/dir2/sub1, /dir1/dir2/sub2 & so on
Server /etc/exports:
/dir1/dir2 *(rw,sync)

Client:
--------
1) mount sub1 in /dir1/sub1 (Not as /dir1/dir2/sub1)

This should be done using autofs.

How to do this???
 
Old 08-03-2009, 01:03 AM   #2
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
read the man page on fstab
Code:
man fstab
and on mount in general
Code:
man mount
 
Old 08-03-2009, 09:17 AM   #3
hariharan.nb
LQ Newbie
 
Registered: Aug 2009
Location: Bangalore, India
Distribution: RHEL4, RHEL5
Posts: 5

Rep: Reputation: 0
1) check autofs service is running

2) check the file /etc/auto.master and look for a file that is mentioned
normally it is /etc/auto.misc, if its the same use that or you can also add or change to a new file of your choice.

3) open the second file and mention the details of the share.
the default /etc/auto.misc contains the sample format in which the data has to be entered
or you can do
# man /etc/auto.master

best regards,
 
Old 08-03-2009, 11:45 PM   #4
Savita Eli
LQ Newbie
 
Registered: Jul 2009
Location: St.Louis,MO
Posts: 13

Original Poster
Rep: Reputation: 0
How to automount nfs shares

Hi,

Not that i dint tried..But, I am fed up with this problem.Trying from past 3 weeks..But no solution..

Here is what i tried:
Server: /etc/exports
/dir1/dir2 *(rw,sync)

Client:
/etc/auto.master:
/dir1 /etc/auto.home

/etc/auto.home:
* -fstype=nfs <server>:/dir1/dir2/&

And when I try to access the sub1, I get the error:
No such file or dir...

I wanted this solution for NIS user login..

So, Is it possible to mount the sub-dirs of server onto single dir in client???????
If so, what shud be my auto.home & auto.master map entries?????
 
Old 08-03-2009, 11:47 PM   #5
Savita Eli
LQ Newbie
 
Registered: Jul 2009
Location: St.Louis,MO
Posts: 13

Original Poster
Rep: Reputation: 0
How to automount nfs shares

Meson,

Understand the question...

I want it using autofs....
 
Old 08-04-2009, 05:57 AM   #6
ahmed_faew
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by Savita Eli View Post
Meson,

Understand the question...

I want it using autofs....
1- on server
create the directories
mkdir /dir1/dir2/sub1
mkdir /dir1/dir2/sub2
vim /etc/exports
/dir1/dir2 *(rw)
:wq
service nfs restart
###########be sure there is no errors



2- on clients
vim /etc/auto.master
/misc /atuo.misc

2- vim /etc/auto.misc

dir -rw server:/dir1/dir2
:wq
#### be sure there is folder /misc
cd /misc
service autofs restart
######## sure that there is no errors
cd dir
####### then you will see the tow directories sub1 & sub2
 
Old 08-04-2009, 04:17 PM   #7
viGeek
LQ Newbie
 
Registered: Jul 2009
Posts: 28

Rep: Reputation: 17
Just throw your mount arguments in /etc/rc.local

This will cause them to mount upon system startup.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
automount NFS shares Savita Eli Linux - Newbie 1 07-24-2009 02:01 PM
automount NFS shares Savita Eli Linux - Networking 1 07-24-2009 01:58 PM
automount NFS shares Savita Eli Red Hat 1 07-24-2009 01:57 PM
automount NFS shares Savita Eli Linux - Server 1 07-24-2009 01:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 03:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration