NFS directory exports

Exporting a directory is done on the NFS server. Exporting a directory declares that a directory in the server's namespace is available to client machines.

The exported directory is referred to as an export, and it includes all files under the directory that reside on the exported directory's file system.

Each export also defines access restrictions. For example, the following restrictions may be defined:
  • which clients may access the exported directory
  • which NFS versions the client must use to access the directory
  • whether the client can write files in the export
  • what security methods the client must use to access directories and files in the export
For a full description of allowable export restrictions and export semantics, see the exportfs command description and the /etc/exports file description.
Note: When an export's attributes are changed, the directory must be re-exported in order for the change to take effect. A directory might need to be re-exported because of changes to other files or changes external to the server. For instance, if a client name specified in an access list is a netgroup defined in the /etc/netgroup file, and the definition of the client group is changed, all exports that use that netgroup in an access list must be re-exported for the change to take effect.

Similarly, if a client's IP address is changed, all exports that specify that client in an access list must be re-exported. The reason for this is because the NFS server maintains a cache of client access rights on each export. The cache is flushed on each unexport or re-export. If the access rights of an export are modified, particularly if the IP address of a client changes or if a client is removed from the access list, an unexport or re-export must be done so the client's access is correctly reflected in the cache. The NFS server calls the rpc.mountd daemon to get the access rights of each client, so the rpc.mountd daemon must be running on the server even if the server only exports file systems for NFS version 4 access.