View previous topic :: View next topic |
Author |
Message |
joshdr77 Apprentice

Joined: 03 Jan 2003 Posts: 152
|
Posted: Thu Jan 30, 2003 1:08 am Post subject: NFS?? |
|
|
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 |
|
|
Sven Vermeulen Developer


Joined: 29 Aug 2002 Posts: 348 Location: Bruges, Belgium
|
Posted: Thu Jan 30, 2003 3:29 am Post subject: |
|
|
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
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 |
|
|
rizzo Developer


Joined: 30 Apr 2002 Posts: 990 Location: Manitowoc, WI, USA
|
Posted: Thu Jan 30, 2003 3:27 pm Post subject: |
|
|
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 |
|
|
rac Administrator


Joined: 30 May 2002 Posts: 6876 Location: Japanifornia
|
Posted: Thu Jan 30, 2003 4:32 pm Post subject: |
|
|
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 |
|
|
Sven Vermeulen Developer


Joined: 29 Aug 2002 Posts: 348 Location: Bruges, Belgium
|
Posted: Fri Jan 31, 2003 3:23 am Post subject: |
|
|
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 |
|
|
Sven Vermeulen Developer


Joined: 29 Aug 2002 Posts: 348 Location: Bruges, Belgium
|
Posted: Fri Jan 31, 2003 3:24 am Post subject: |
|
|
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 |
|
|
rizzo Developer


Joined: 30 Apr 2002 Posts: 990 Location: Manitowoc, WI, USA
|
Posted: Fri Jan 31, 2003 9:08 am Post subject: |
|
|
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 |
|
|
|