First, check whether the NFS package is installed.
[[Email protected] desktop] # rpm-Qa | grep nfs-utils
Nfs-utils-lib-1.1.5-4.el6.x86_64
Nfs-utils-1.2.3-26.el6.x86_64
If not, use yum for installation.
[[Email protected] desktop] # Yum install nfs-utils
The NFS service depends on the rpcbind service, because the rpcbind is started before the NFS service is started.
[[Email protected] desktop] # service rpcbind start
Starting rpcbind: [OK]
Then start the NFS service.
[[Email protected] desktop] # service NFS start
Starting NFS services: [OK]
Starting NFS quotas: [OK]
Starting NFS mountd: [OK]
Stopping RPC idmapd: [OK]
Starting RPC idmapd:
The NFS configuration file is/etc/exports. The format is as follows:
Each row defines a shared directory. Each field in each row is as follows.
Directory to be shared, such as/share directory
Persons to be shared with, such as the machine name, IP address, and IP address segment
Client-mounted parameters such as RW, Ro, sync, async, and no_root_squash
Example:
/Share * (RW, Asyn, no_root_squash)