See Also: nfs How-To: Setting Up an NFS Server

Setting Up an NFS Server

In order to support NetworkBooting we need to have tftp for the kernel, and NFS for the root filesystem. Until we build one of our own, we'll use a debian one pre-built for mips.

We need

  • NFS utilities (and dependencies)
  • a root filesystem to mount
  • config files: /etc/exports, /etc/hosts.allow, /etc/hosts.deny
  • launch the daemons

NFS from source

We want to build the NFS utility software from source and we are using a Linux machine. Right? Good.

The NFS utilities per se are easy to build and install for Linux. Unfortunately, NFS also relies on the RPC Portmapper, and there is no version of that program that is easy to build on modern Linux systems. Bleah. The version I suggest is the one from porcupine.org, which unfortunately needs a patch to build, and also depends on the TCP wrappers package, which is also not easy to build on modern Linux systems and requires a patch to build.

(more details to follow)

debian root filesystem

Config files

/etc/exports

/tmp/fsanfs 192.168.236.0/255.255.255.0(rw,no_root_squash)

/etc/hosts.allow

portmap:192.168.236.0/255.255.255.0
lockd:192.168.236.0/255.255.255.0
rquotad:192.168.236.0/255.255.255.0
mountd:192.168.236.0/255.255.255.0
statd:192.168.236.0/255.255.255.0

run the NFS daemons

portmap
rpc.mountd
rpc.nfsd
rpc.statd
rpc.lockd
rpc.rquotad

Notes

To tell nfsd that it should check again with /etc/exports you may need to run

exportfs -ra

The debian root filesystem is not a built environment out of the box:

asus-debian:~# ./version-check.sh 
Linux asus-debian 2.6.19.2 #3 Fri Apr 27 22:44:55 CEST 2007 mips GNU/Linux
bash, version 3.1.17(1)-release
Binutils: ./version-check.sh: line 8: ld: command not found
./version-check.sh: not found
Coreutils:  5.97
diff (GNU diffutils) 2.8.1
GNU find version 4.2.28
GNU Awk 3.1.5
./version-check.sh: line 14: gcc: command not found
GNU C Library stable release version 2.3.6,
grep (GNU grep) 2.5.1
gzip 1.3.5
./version-check.sh: line 18: make: command not found
./version-check.sh: line 19: patch: command not found
GNU sed version 4.1.5
tar (GNU tar) 1.16
asus-debian:~#

Attachments