System information

It is possible to specify multiple hosts, along with specific options for each host. To do so, list them
on the same line as a space-delimited list, with each hostname followed by its respective options (in
parentheses), as in:
export host1(options1) host2(options2) host3(options3)
For information on different methods for specifying hostnames, refer to Section 9.7.4, “Hostname
Formats .
In its simplest form, the /etc/expo rts file only specifies the exported directory and the hosts
permitted to access it, as in the following example:
Examp le 9 .6 . T h e /etc/expo rts f ile
/exported/directory bob.example.com
Here, bo b. exampl e. co m can mount /expo rted /d i recto ry/ from the NFS server. Because no
options are specified in this example, NFS will use default settings.
The default settings are:
ro
The exported file system is read-only. Remote hosts cannot change the data shared on the
file system. To allow hosts to make changes to the file system (that is, read/write), specify the
rw option.
sync
The NFS server will not reply to requests before changes made by previous requests are
written to disk. To enable asynchronous writes instead, specify the option async.
wd elay
The NFS server will delay writing to the disk if it suspects another write request is imminent.
This can improve performance as it reduces the number of times the disk must be accesses
by separate write commands, thereby reducing write overhead. To disable this, specify the
no _wd el ay. no _wd el ay is only available if the default sync option is also specified.
ro o t _squash
This prevents root users connected remotely (as opposed to locally) from having root
privileges; instead, the NFS server will assign them the user ID nfsno bo d y. This effectively
"squashes" the power of the remote root user to the lowest local user, preventing possible
unauthorized writes on the remote server. To disable root squashing, specify
no _ro o t_sq uash.
To squash every remote user (including root), use al l _sq uash. To specify the user and group IDs
that the NFS server should assign to remote users from a particular host, use the ano nui d and
ano ng i d options, respectively, as in:
export host(anonuid=uid,anongid=gid)
Here, uid and gid are user ID number and group ID number, respectively. The ano nui d and
ano ng i d options allow you to create a special user and group account for remote NFS users to
share.
Red Hat Ent erprise Lin ux 6 St orage Admin ist rat io n G uide
64