click me  

     Return to Linux Home Page.


Exporting a File System for NFS - (/etc/exports)

by Jeff Hunter, Sr. Database Administrator


Overview

This article presents the methods for preparing a set of directories that can be exported to NFS clients using Linux. Under Linux this is can be accomplished by editing the /etc/exports file.

For the purpose of this example, I will be exporting (sharing) the directory /mnt/software.

About the /etc/exports File
The /etc/exports file contains an entry for each directory that can be exported to NFS clients. This file is read automatically by the exportfs command. If you change this file, you must run the exportfs command before the changes can affect the way the daemon operates.

Only when this file is present during system startup does the rc.nfs script execute the exportfs command and start the nfsd and mountd daemons.

Edit the exports file vi /etc/exports and add:

/dir/to/export host1.mydomain.com(ro,root_squash)
/dir/to/export host2.mydomain.com(ro,root_squash)
Where:

For this change to take effect you will need to run the following command on your terminal:

[root@linux2 /]# /usr/sbin/exportfs -a
Examples



Last modified on: Tuesday, 26-Jul-2005 13:57:13 EDT
Page Count: 39575