Yesterday I put together a quick how-to that outlines how to install, configure, and operate a Samba server so today I am going to follow that up with a similar how-to that will cover installing, configuring, and testing an NFS file server.
NFS, or Network File System, uses the Remote Procedure Call (RPC) framework to provide connectivity. NFS is a network protocol which was developed by Sun Microsystems. As in many of my how-tos I am going to explain how to set this up using the Debian Linux operating environment. Let us assume one client and one server at 10.0.0.2 and 10.0.0.19 respectively.
On the server, which we’ll be calling nfs.server, the first step is to install the necessary software:
apt-get install nfs-kernel-server nfs-common portmap
For this example we’re going to setup a single share called /var/group_share/ which all clients will attach to. First create this directory using “mkdir /var/group_share” and “chown nobody:nogroup /var/group_share” because clients which access shares usually occurs as the nobody user. The next step is to make sure that the NFS server is aware of this /var/group_share resource using the /etc/exports file. Open up /etc/exports and append the following line to the bottom for our resource:
/var/group_share 10.0.0.19(rw,sync)
save the file you’ve exported. In other tutorials I’ve asked that the particular resource be restarted to make the changes relevant to the service. However, in this case, you have to use the following command to add the shared resource to the list of available exports:
exportfs -a
you run this command after EVERY change to /etc/exports. Now let’s move on to the client. Assuming a Debian Linux client you execute the following to setup the client to be able to access NFS shares:
apt-get install nfs-common portmap
when your installation completes you are going to need to mount your shares. In your favorite console execute the following to mount (or NFS-mount) the new share:
mkdir -p /mnt/nfs/var/group_share
mount 10.0.0.19:/var/group_share /mnt/nfs/var/group_share
this shared resource will now be available to the client machine. Looking at the output of the “df” command will display your new share like this:
10.0.0.19:/var/group_share 1G 6M 993M 1% /mnt/nfs/var/group_share
this indicates the server IP and remote mount point, that the share is 1GB in size, 6MB are in use, 993 MB are free, use is at about 1% and the local mount point.
There you have it.

No comments yet
Comments feed for this article