Pick a Free OS

User login

Navigation

Sharing, the NFS way

Under Windows, through network neighborhood, you can browse through available shares on other machines, run applications and of course transfer data. NFS is somewhat similar, but much more flexible. We've got diskless machines on our network that access their root filesystem using NFS. You can centralize the location of user home directories which users access via NFS. Since Linux uses a unified filesystem, it is completely transparent to the user. You can run an application off another machine as though it was installed on your own machine simply by mounting that directory using NFS.

NFS is also very easy to install and use. It is now part of the standard installation of most, if not all Linux distributions. So this is where we'll ask you to start. Check the CD of your Linux distribution and look for the packages nfs-utils (Red Hat) or nfsserv (SuSE). There is also a new kernel based NFS server. The advantage of this is speed. We are going to work with the stand-alone daemon in this article, the version being

2.2. Also look for and install the portmap program if not already installed. NFS won't work without this one running.

Installation is a simple "rpm -ivh nfsserv-2.2beta47-120.i386.rpm".

NFS configuration involves "exporting" a directory, which can then be "imported" by clients and are then accessible under the mount point.

NFS configuration is as simple as the installation. There is just one file to edit. /etc/exports contains a list of the directories to export as well as the permissions and clients to export to.

The general format of the file is

/directory/to/export hostname(options)

e.g. - /mnt/test nfsclient.freeos.com(rw)

This exports the directory /mnt/test to the machine nfsclient.freeos.com with read-write permissions.

The hostnames/machines you will be exporting to, can be listed by their hostnames, IP addresses, address/netmask pairing or you could just choose to export to everyone who asks for that exported directory.

Hostname - nfsclient.freeos.com. Here, we are directly specifying the hostname of the client that is allowed access to the exported directory. Wildcards are allowed, but they do not work for a sub-domain of the domain specifies. If you specify *.freeos.com in the access list, abc.freeos.com and def.abc.freeos.com will be able to mount the exported directory, but xyz.abc.freeos.com will not have access.

/mnt/test nfs.freeos.com(rw) news.freeos.com

IP addresses - Simply give the IP address of the client.