NFS Tutorial :: Install
NFS (Network File System) can provide centralized file storage for Unix and Linux systems. NFS is a powerful system that is very easy to implement.
When combined with OpenLDAP and Samba, these systems can provide a complete cross-platform "heterogeneous" file and login system
This self-help tutorial covers installation and configuration of an NFS server and client in a Ubuntu environment.
NFS, Network File Services under the hood
Let's look at how the NFS thing goes down:
On the server side, we have at least two packages. nfs-kernel-server gives us the nfsd daemon and nfsd.o kernel module. nfsd essentially answers the phone when a client wants to mount an NFS volume.
The second package the server needs is nfs-common. This module will also be on the clients. nfs-common provides utilities like nfsstat and statd.
Install this thing.
Install nfs-kernel-server and nfs-common
apt-get install nfs-kernel-server
apt-get install nfs-common
That wasn't so hard, now was it?
Configuring NFS with /etc/exports
The file that tells NFS what to "share" is /etc/exports. In NFS terminology, the word is "export".
The /etc/exports file also specifies some of the settings of the session. For example, the version of NFS protocol to use, synchronous or ansynchronous read / write modes, and things like how to handle root accounts.
Here's and example:
/mnt/storage 192.168.0.5(rw,sync,no_root_squash,no_subtree_check)
This tells NFS to allow the directory /mnt/storage to be used by IP address 192.168.0.5, and that client can read and write, in the synchronous mode. If the root user at 192.168.0.5 is trying to mount, allow that person to be root on this exported directory too.
There are a lot more options you can specify here, and you can use CIDR notation to allow a range of IPs. You can have multiple hosts allowed to the same directory, and you can specify multiple directories.
Now restart NFS to include the new exports OR run exportfs -a to notify NFS of the changes.


