How to configure NFS
On large networks, it might be more convenient to configure a central NFS server in which to store all the user home directories. These home directories can then be exported to the network so that users would always have the same home directory, regardless of which workstation they log in to.
Several machines could have a common source directory. That way, when you need to install a port on several machines, you can quickly access the source without downloading it on each machine.
In our example, we want to configure an NFS server on a FreeBSD 7.2 operating system, so one or more Ubuntu workstations can mount and work on central home directories on the server.
It is assumed, that users has the same user ID and group ID on all machines.
On the server, we need to make sure, that the NFS server nfsd is started at boot time, that it serves TCP NFS clients, that it serves UDP NFS clients, that it creates a specific amount of servers, and, that it binds to a specific IP address. If the server has more than one network interface, this is important.
We also need to make sure, that the mountd utility, that listens for service requests from NFS clients, is started at boot time. We might want to allow for regular files to be served as well.
vi /etc/rc.conf
nfs_server_enable="YES"
nfs_server_flags="-t -u -n 4 -h 192.168.1.10"
mountd_flags="-r"
Then we need to configure the remote mount points for the NFS client requests. That is, which directories, homes, that are shared. This is done in the exports file. We want to share specific homes, translate their local credentials to the remote credentials, and, lock the share to a specific IP address.
vi exports
/usr/home -maproot=root -alldirs -network 192.168.1 -mask 255.255.255.0
If you make changes to this configuration, the mountd utility must be restarted. Any errors will be logged using syglogd.
killall -HUP mountd && tail /var/log/messages
Now, we need to install the NFS client on the Ubuntu workstations.
sudo apt-get install portmap nfs-common
Then we configure the static information about file systems.
sudo nano -w /etc/fstab
starnix:/usr/home/ann /home/ann/starnix nfs rw 1 1
starnix:/usr/home/bill /home/bill/starnix nfs rw 1 1
Make sure, that the local directories exist.
That’s it. We mount the remote file systems, specified in the static table, and we can use the central homes.
sudo mount -a
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
