Gentoo Forums
Gentoo Forums
Quick Search:
NFS??

 
Post new topic   Reply to topic    Gentoo Forums Forum Index -> Networking & Security
View previous topic :: View next topic  
Author Message
joshdr77
Apprentice
Apprentice


Joined: 03 Jan 2003
Posts: 152

PostPosted: Thu Jan 30, 2003 1:08 am    Post subject: NFS?? Reply with quote

how do u work nfs....i tryed to follow a howto but i get permission denied? i think everything is set up correctly, not sure?

thanks
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Sven Vermeulen
Developer
Developer


Joined: 29 Aug 2002
Posts: 348
Location: Bruges, Belgium

PostPosted: Thu Jan 30, 2003 3:29 am    Post subject: Reply with quote

First, make sure nfs-client-support is enabled in the kernel of the client that wants to mount a nfs-share.

Second, make sure the nfs-server support is enabled in the kernel of the server that wants to export nfs-shares.

Third, emerge nfs-utils on the server.

Fourth, edit /etc/hosts.allow and /etc/hosts.deny on the server so that only the appropriate systems can mount nfs-shares.
Code:

~$ cat /etc/hosts.deny
portmap: ALL
lockd:   ALL
mountd:  ALL
rquotad: ALL
statd:   ALL

~$ cat /etc/hosts.allow
portmap: 192.168.0.20
lockd:   192.168.0.20
rquotad: 192.168.0.20
mountd:  192.168.0.20
statd:   192.168.0.20

In the above case, only the host with ip 192.168.0.20 is allowed access.

Fifth, startup the nfs daemon on the server

Code:

~# /etc/init.d/nfs start

If everything works, don't forget to add it to the default runlevel
Code:

~# rc-update add nfs default


Sixth, edit /etc/exports so that it mentions the shares. In my example, this would be:
Code:

~$ cat /etc/exports
# /etc/exports: NFS file systems being exported.  See exports(5).
/usr/portage            192.168.0.20(ro,sync)
/usr/portage/distfiles  192.168.0.20(ro,sync)

Since (in my case) 192.168.0.20 only needs the portage-tree for read-only access (it will not dl sourcecode nor alter ebuilds) it can only be accessed readonly.

Have nfs reread the /etc/exports-file
Code:

~# exportfs -a


At last, you can now mount the shares on the client:
Code:

~# mount -t nfs -o nolock 192.168.0.10:/usr/portage /usr/portage
~# mount -t nfs -o nolock 192.168.0.10:/usr/portage/distfiles /usr/portage/distfiles


I use nolock here since the mounting is only needed occasionally (when the server - 192.168.0.20 is a testing server - needs access to portage, which only happens twice a week) and I don't want to have any more daemons running on the server than necessary (if you want to have it without nolock, you need to emerge nfs-utils on that client too so that portmap and rpc.* can communicate to eachother).

Note that this is *not* a TCP-NFS connection.

You might want to use a firewall to disable any communication to portmap/rpc.* to the server from hosts that aren't allowed access (I know, /etc/hosts.allow/deny takes care of that, but better be double-teamed than sorry).
Back to top
View user's profile Send private message Visit poster's website  
rizzo
Developer
Developer


Joined: 30 Apr 2002
Posts: 990
Location: Manitowoc, WI, USA

PostPosted: Thu Jan 30, 2003 3:27 pm    Post subject: Reply with quote

Why do you export /usr/portage and /usr/portage/distfiles separately? Wouldn't you get the distfiles dir from /usr/portage?

I'm trying to do something similar, only I want my clients to be able write to the distfiles dir if they need to download the source. I'm exporting /usr/portage with auto,rw,hard,intr parameters which I got from this thread. However my client machine hangs and the mount process shows up as "D" in the "ps auwwwx" list when I try it.

I noticed that my client machine didn't have nfs-utils installed, nor does it have portmap installed. I'm installing nfs-utils now, do I need portmap installed?
_________________
web hosting
Back to top
View user's profile Send private message Send e-mail Visit poster's website  
rac
Administrator
Administrator


Joined: 30 May 2002
Posts: 6876
Location: Japanifornia

PostPosted: Thu Jan 30, 2003 4:32 pm    Post subject: Reply with quote

rizzo wrote:
do I need portmap installed?
Yes - I think I mentioned this in your other thread.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message Send e-mail Visit poster's website  
Sven Vermeulen
Developer
Developer


Joined: 29 Aug 2002
Posts: 348
Location: Bruges, Belgium

PostPosted: Fri Jan 31, 2003 3:23 am    Post subject: Reply with quote

rizzo wrote:
Why do you export /usr/portage and /usr/portage/distfiles separately? Wouldn't you get the distfiles dir from /usr/portage?

Here /usr/portage/distfiles is a seperate partition, and NFS won't export seperate partitions (or not default).
Back to top
View user's profile Send private message Visit poster's website  
Sven Vermeulen
Developer
Developer


Joined: 29 Aug 2002
Posts: 348
Location: Bruges, Belgium

PostPosted: Fri Jan 31, 2003 3:24 am    Post subject: Reply with quote

rac wrote:
Yes - I think I mentioned this in your other thread.

And if this still doesn't work, try the "-o nolock" switch...
Back to top
View user's profile Send private message Visit poster's website  
rizzo
Developer
Developer


Joined: 30 Apr 2002
Posts: 990
Location: Manitowoc, WI, USA

PostPosted: Fri Jan 31, 2003 9:08 am    Post subject: Reply with quote

I was just thinking you might have them on separate partitions.

Anyway yes it was a (lack of) portmap problem.

Thanks to all for helping.
_________________
web hosting
Back to top
View user's profile Send private message Send e-mail Visit poster's website  
Display posts from previous:   
Post new topic   Reply to topic    Gentoo Forums Forum Index -> Networking & Security All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum