8.3. Configuring NFS Client
mountcommand mounts NFS shares on the client side. Its format is as follows:
mount -t nfs -o options server:/remote/export /local/directory
- A comma-delimited list of mount options; for more information on valid NFS mount options, see Section 8.5, “Common NFS Mount Options”.
- The hostname, IP address, or fully qualified domain name of the server exporting the file system you wish to mount
- The file system or directory being exported from the server, that is, the directory you wish to mount
- The client location where /remote/export is mounted
vers. By default,
mountuses NFSv4 with
mount -t nfs. If the server does not support NFSv4, the client automatically steps down to a version supported by the server. If the
versoption is used to pass a particular version not supported by the server, the mount fails. The file system type nfs4 is also available for legacy reasons; this is equivalent to running
mount -t nfs -o nfsvers=4 host:/remote/export /local/directory.
/etc/fstabfile and the
autofsservice. For more information, see Section 8.3.1, “Mounting NFS File Systems Using
/etc/fstab” and Section 8.4, “
8.3.1. Mounting NFS File Systems Using
/etc/fstabfile. The line must state the hostname of the NFS server, the directory on the server being exported, and the directory on the local machine where the NFS share is to be mounted. You must be root to modify the
Example 8.1. Syntax Example
/etc/fstabis as follows:
server:/usr/local/pub /pub nfs defaults 0 0
/pubmust exist on the client machine before this command can be executed. After adding this line to
/etc/fstabon the client system, use the command
mount /pub, and the mount point
/pubis mounted from the server.
/etc/fstabentry to mount an NFS export should contain the following information:
server:/remote/export /local/directory nfs options 0 0
/etc/fstabis read. Otherwise, the mount fails.
/etc/fstab, regenerate mount units so that your system registers the new configuration:
- For more information about
/etc/fstab, refer to