How /etc/exports works
About /etc/exports
The /etc/exports file contains the list of resources to be exported when Data ONTAP starts up, restarts, or receives the exportfs -a command (given that a valid NFS license exists). Maintaining the /etc/exports file enables resources to be available automatically upon filer startup and eliminates the need to enter the exportfs command for each resource you want to export.
In the /etc/exports file, you also specify the access restrictions and security service with which clients can mount each resource. At any time after filer startup, you can override specifications in the /etc/exports file by using the exportfs command (until the filer is restarted or another overriding exportfs command is issued).
When changes to /etc/exports take effect
Entries in the /etc/exports file take effect when one of the following events happens:
- Data ONTAP executes the exportfs -a command. This exports all entries in the /etc/exports file.
- Data ONTAP executes the exportfs -r command. This re-exports all entries in the /etc/exports file into memory and removes from memory all non-persistent (command line) exports.
- You enter the exportfs command followed by a path name specified in the /etc/exports file. This exports the specified entry.
For more information about how to use the exportfs command, see Exporting or unexporting resources using the exportfs command.
Targets to which you export a resource
You can specify in the /etc/exports file to export a resource to these targets:
- DNS subdomains
- Hosts
- Netgroups
- Subnets
Information in /etc/exports
The /etc/exports file specifies the following types of information:
- Complete path name of each resource to be exported
- Targets to which each resource is exported. Targets are optional.
- Access restrictions with which each resource can be mounted. Access restrictions are optional.
- Security service each resource uses. Security services are optional.
Rules for specifying an /etc/exports entry
The following rules determine how a resource is exported:
- If the /etc/exports file entry contains only the path name of a resource, that resource can be mounted by all hosts as a read-write resource.
- If an /etc/exports file entry contains the path name of a resource followed by export options, the resource is exported with the specified access restrictions, which determine
- Which targets have permission to mount the resource
- The type of access allowed for each target (for example, read-only or read-write)
- How NFS requests made by root on the client are handled. The requests can be denied, allowed, or allowed with a converted UID
- In an /etc/exports file entry, the first access restriction option is preceded by a dash (-). Subsequent options are preceded by a comma (,). Multiple hosts associated with the same access restriction are separated by a colon (:).
Example
/vol/vol0 -ro=host1:host3,root=host1,rw=host2
The steps for exporting a resource from the /etc/exports file vary according to the type of target to which you export the resource.
For detailed information
The following sections describe how different options in the /etc/exports file control the ways resources are exported:
Copyright © 1994-2003, Network Appliance, Inc. All rights
reserved.
Part No. 210-00473
File: nfs4.htm
Last updated: 11/25/03 18:02:36