nfs - nfs and nfs4 fstab format and options /etc/fstab

The fstab file contains information about which filesystems to mount where and with what options. For NFS mounts, it contains the server name and exported server directory to mount from, the local directory that is the mount point, and the NFS specific options that control the way the filesystem is mounted.

    Different versions of the NFS protocol are supported by the Linux NFS client:
  1. version 2, use -t nfs nfsvers=2
  2. version 3, (default)use the -t nfs
  3. version 4, use -t nfs4

These file system types share similar mount options;

Here is an example from an /etc/fstab file for an NFSv2 mount over UDP.

server:/usr/local/pub /pub nfs rsize=32768,wsize=32768,timeo=14,intr
Here is an example for an NFSv4 mount over TCP using Kerberos 5 mutual authentication.
server:/usr/local/pub /pub nfs4 proto=tcp,sec=krb5,hard,intr

logical options have corresponding nooption forms. For example, nointr means don't allow file operations to be interrupted.
fsc Enable persistent caching to the local disk using the FSCache facility.
acregmin=n minimum seconds attributes of a regular file should be cached default 3.
acregmax=n maximum, default 60
acdirmin=n minimum seconds attributes of a directory should be cached default 30
acdirmax=n maximum, default 60
actimeo=n sets acregmin, acregmax, acdirmin and acdirmax to the same value.
noac Disable attribute caching. This significant performance penalty
It allows two different NFS clients to get reasonable results when both clients are actively writing to a common export on the server.
nocto Suppress the retrieval of new attributes when creating a file.
 
timeo=n tenths of a second before sending the first retransmission after an RPC timeout. default 7 .
After the first timeout, the time is doubled after each successive timeout until a maximum timeout of 60 seconds is reached or the enough retransmissions have occured to cause a major timeout.
If the filesystem is hard mounted, each new timeout cascade restarts at twice the initial value of the previous cascade, again doubling at each retransmission.
The maximum timeout is always 60 seconds.
Better overall performance may be achieved by increasing the timeout when mounting on a busy network, to a slow server, or through several routers or gateways.
retrans=n number of minor timeouts and retransmissions that must occur before a major timeout occurs.
default 3. When a major timeout occurs, the file operation is either aborted or a "server not responding" message is output.
retry=n minutes to retry an NFS mount operation in the foreground or background before giving up. default for forground mounts is 2 minutes. background 10,000 minutes, roughly one week.
 
namlen=n When an NFS server does not support version two of the RPC mount protocol, this option can be used to specify the maximum length of a filename that is supported on the remote filesystem.
This is used to support the POSIX pathconf functions. default 255 characters.
port=n If the port is 0 (default) query the remote host's portmapper for the port number to use.
If the remote host's NFS daemon is not registered with its portmapper, the standard NFS port number 2049 is used instead.
proto=n use a specific network protocol UDP and TCP. default TCP .
 
mountport=n mountd port.
mounthost=name The name of the host running mountd .
 
mountprog=n Use an alternate RPC program number to contact the mount daemon on the remote host. This option is useful for hosts that can run multiple NFS servers. default 100005 which is the standard RPC mount daemon program number.
mountvers=n "     "     "     "     "     version number "   "   "   "   "   mount daemon …
nfsprog=n "     "     "     "     "     program number to contact the NFS daemon …
nfsvers=n
vers=n
"     "     "     "     "     version number "   "   "   "   "  
 
nolock Disable NFS locking. Do not start lockd.
 
fg If the first NFS mount attempt times out, retry the mount in the foreground. default behavior.
bg If the first NFS mount attempt times out, retry the mount in the background.
After a mount operation is backgrounded, subsequent mounts on the same NFS server will be backgrounded
A missing mount point is treated as a timeout, to allow for nested NFS mounts.
 
hard If a file operation has a major timeout then "server not responding" and continue retrying indefinitely. default.
soft            "        "        "        "        "        "   report an I/O error to the calling program.
 
intr If an NFS file operation has a major timeout and it is hard mounted, then allow signals to interupt the file operation and cause it to return EINTR to the calling program.
Default is to not allow file operations to be interrupted.
posix Mount the NFS filesystem using POSIX semantics. allows proper support iof the pathconf command by querying the mount server for the maximum length of a filename.
The remote host must support version two of the RPC mount protocol.
noacl Disables Access Control List (ACL) processing.
sec=mode Security version for this mount to "mode". default is
sec=sys use local unix uids and gids to authenticate NFS operations (AUTH_SYS).
sec=krb5 use Kerberos V5
sec=krb5i use Kerberos V5 for user authentication and performs integrity checking of NFS operations using secure checksums to prevent data tampering; and
sec=krb5p use Kerberos V5 for user authentication and integrity checking, and encrypts NFS traffic to prevent traffic sniffing (this is the most secure setting). Note that there is a performance penalty when using integrity or privacy.
 
rsize=n maximum bytes used when reading files from an NFS server.
Negotiated between the server and client to determine the largest block size both can support. The actual size used may be smaller.
wsize=n maximum bytes uses when writing files …
 
tcp use the TCP protocol. default
udp use the UDP protocol
 
nordirplus Disables NFSv3 READDIRPLUS RPCs. Use this options when mounting servers that don't support READDIRPLUS implementations.
nosharecache Beware: Use of this option is not recommended unless you are certain that there are no hard links or subtrees of this mountpoint that are mounted elsewhere.

FILES

/etc/fstab

SEE ALSO

fstab(5), mount(8), umount(8), exports(5)

AUTHOR

"Rick Sladkey"

BUGS

The posix option is implemented but is currently ignored by the Linux kernel. Checking files on NFS filesystem referenced by file descriptors (i.e. the fcntl and ioctl families of functions) may lead to inconsistent result due to the lack of con- sistency check in kernel even if noac is used.