2 .TH NFS 5 "2 November 2007"
4 nfs \- fstab format and options for the
10 NFS is an Internet Standard protocol
11 created by Sun Microsystems in 1984. NFS was developed
12 to allow file sharing between systems residing
13 on a local area network.
14 The Linux NFS client supports three versions
16 NFS version 2 [RFC1094],
17 NFS version 3 [RFC1813],
18 and NFS version 4 [RFC3530].
22 command attaches a file system to the system's
23 name space hierarchy at a given mount point.
28 should assemble a system's file name hierarchy
29 from various independent file systems
30 (including file systems exported by NFS servers).
33 file describes a single file system, its mount point,
34 and a set of default mount options for that mount point.
36 For NFS file system mounts, a line in the
38 file specifies the server name,
39 the path name of the exported server directory to mount,
40 the local directory that is the mount point,
41 the type of file system that is being mounted,
42 and a list of mount options that control
43 the way the filesystem is mounted and
44 how the NFS client behaves when accessing
45 files on this mount point.
46 The fifth and sixth fields on each line are not used
47 by NFS, thus conventionally each contain the digit zero. For example:
50 .ta 8n +14n +14n +9n +20n
51 server:path /mountpoint fstype option,option,... 0 0
54 The server's hostname and export pathname
55 are separated by a colon, while
56 the mount options are separated by commas. The remaining fields
57 are separated by blanks or tabs.
59 The server's hostname can be an unqualified hostname,
60 a fully qualified domain name,
61 a dotted quad IPv4 address, or
62 an IPv6 address enclosed in square brackets.
63 Link-local and site-local IPv6 addresses must be accompanied by an
67 for details on specifying raw IPv6 addresses.
71 field contains "nfs". Use of the "nfs4" fstype in
77 for a description of generic mount options
78 available for all file systems. If you do not need to
79 specify any mount options, use the generic option
84 .SS "Options supported by all versions"
85 These options are valid to use with any NFS version.
88 Determines the recovery behavior of the NFS client
89 after an NFS request times out.
90 If neither option is specified (or if the
92 option is specified), NFS requests are retried indefinitely.
95 option is specified, then the NFS client fails an NFS request
98 retransmissions have been sent,
99 causing the NFS client to return an error
100 to the calling application.
103 A so-called "soft" timeout can cause
104 silent data corruption in certain cases. As such, use the
106 option only when client responsiveness
107 is more important than data integrity.
108 Using NFS over TCP or increasing the value of the
110 option may mitigate some of the risks of using the
115 The time in deciseconds (tenths of a second) the NFS client waits for a
116 response before it retries an NFS request.
118 For NFS over TCP the default
120 value is 600 (60 seconds).
121 The NFS client performs linear backoff: After each retransmission the
122 timeout is increased by
124 up to the maximum of 600 seconds.
126 However, for NFS over UDP, the client uses an adaptive
127 algorithm to estimate an appropriate timeout value for frequently used
128 request types (such as READ and WRITE requests), but uses the
130 setting for infrequently used request types (such as FSINFO requests).
133 option is not specified,
134 infrequently used request types are retried after 1.1 seconds.
135 After each retransmission, the NFS client doubles the timeout for
137 up to a maximum timeout length of 60 seconds.
140 The number of times the NFS client retries a request before
141 it attempts further recovery action. If the
143 option is not specified, the NFS client tries each request
146 The NFS client generates a "server not responding" message
149 retries, then attempts further recovery (depending on whether the
151 mount option is in effect).
154 The maximum number of bytes in each network READ request
155 that the NFS client can receive when reading data from a file
157 The actual data payload size of each NFS READ request is equal to
160 setting. The largest read payload supported by the Linux NFS client
161 is 1,048,576 bytes (one megabyte).
165 value is a positive integral multiple of 1024.
168 values lower than 1024 are replaced with 4096; values larger than
169 1048576 are replaced with 1048576. If a specified value is within the supported
170 range but not a multiple of 1024, it is rounded down to the nearest
175 value is not specified, or if the specified
177 value is larger than the maximum that either client or server can support,
178 the client and server negotiate the largest
180 value that they can both support.
184 mount option as specified on the
186 command line appears in the
188 file. However, the effective
190 value negotiated by the client and server is reported in the
195 The maximum number of bytes per network WRITE request
196 that the NFS client can send when writing data to a file
197 on an NFS server. The actual data payload size of each
198 NFS WRITE request is equal to
201 setting. The largest write payload supported by the Linux NFS client
202 is 1,048,576 bytes (one megabyte).
208 value is a positive integral multiple of 1024.
211 values lower than 1024 are replaced with 4096; values larger than
212 1048576 are replaced with 1048576. If a specified value is within the supported
213 range but not a multiple of 1024, it is rounded down to the nearest
218 value is not specified, or if the specified
220 value is larger than the maximum that either client or server can support,
221 the client and server negotiate the largest
223 value that they can both support.
227 mount option as specified on the
229 command line appears in the
231 file. However, the effective
233 value negotiated by the client and server is reported in the
238 Selects whether the client may cache file attributes. If neither
239 option is specified (or if
241 is specified), the client caches file
244 To improve performance, NFS clients cache file
245 attributes. Every few seconds, an NFS client checks the server's version of each
246 file's attributes for updates. Changes that occur on the server in
247 those small intervals remain undetected until the client checks the
250 option prevents clients from caching file
251 attributes so that applications can more quickly detect file changes
254 In addition to preventing the client from caching file attributes,
257 option forces application writes to become synchronous so
258 that local changes to a file become visible on the server
259 immediately. That way, other clients can quickly detect recent
260 writes when they check the file's attributes.
264 option provides greater cache coherence among NFS clients
265 accessing the same files,
266 but it extracts a significant performance penalty.
267 As such, judicious use of file locking is encouraged instead.
268 The DATA AND METADATA COHERENCE section contains a detailed discussion
272 The minimum time (in seconds) that the NFS client caches
273 attributes of a regular file before it requests
274 fresh attribute information from a server.
275 If this option is not specified, the NFS client uses
279 The maximum time (in seconds) that the NFS client caches
280 attributes of a regular file before it requests
281 fresh attribute information from a server.
282 If this option is not specified, the NFS client uses
286 The minimum time (in seconds) that the NFS client caches
287 attributes of a directory before it requests
288 fresh attribute information from a server.
289 If this option is not specified, the NFS client uses
293 The maximum time (in seconds) that the NFS client caches
294 attributes of a directory before it requests
295 fresh attribute information from a server.
296 If this option is not specified, the NFS client uses
309 If this option is not specified, the NFS client uses
310 the defaults for each of these options listed above.
315 command behaves if an attempt to mount an export fails.
320 to exit with an error status if any part of the mount request
321 times out or fails outright.
322 This is called a "foreground" mount,
323 and is the default behavior if neither the
327 mount option is specified.
331 option is specified, a timeout or failure causes the
333 command to fork a child which continues to attempt
335 The parent immediately returns with a zero exit code.
336 This is known as a "background" mount.
338 If the local mount point directory is missing, the
340 command acts as if the mount request timed out.
341 This permits nested NFS mounts specified in
343 to proceed in any order during system initialization,
344 even if some NFS servers are not yet available.
345 Alternatively these issues can be addressed
346 using an automounter (refer to
351 The number of minutes that the
353 command retries an NFS mount operation
354 in the foreground or background before giving up.
355 If this option is not specified, the default value for foreground mounts
356 is 2 minutes, and the default value for background mounts is 10000 minutes
357 (80 minutes shy of one week).
358 If a value of zero is specified, the
360 command exits immediately after the first failure.
363 The RPCGSS security flavor to use for accessing files on this mount point.
366 option is not specified, or if
368 is specified, the NFS client uses the AUTH_SYS security flavor
369 for all NFS requests on this mount point.
370 Valid security flavors are
377 Refer to the SECURITY CONSIDERATIONS section for details.
379 .BR sharecache " / " nosharecache
380 Determines how the client's data cache and attribute cache are shared
381 when mounting the same export more than once concurrently. Using the
382 same cache reduces memory requirements on the client and presents
383 identical file contents to applications when the same remote file is
384 accessed via different mount points.
386 If neither option is specified, or if the
389 specified, then a single cache is used for all mount points that
390 access the same export. If the
393 then that mount point gets a unique cache. Note that when data and
394 attribute caches are shared, the mount options from the first mount
395 point take effect for subsequent concurrent mounts of the same export.
397 As of kernel 2.6.18, the behavior specified by
399 is legacy caching behavior. This
400 is considered a data risk since multiple cached copies
401 of the same file on the same client can become out of sync
402 following a local update of one of the copies.
404 .BR resvport " / " noresvport
405 Specifies whether the NFS client should use a privileged source port
406 when communicating with an NFS server for this mount point.
407 If this option is not specified, or the
409 option is specified, the NFS client uses a privileged source port.
412 option is specified, the NFS client uses a non-privileged source port.
413 This option is supported in kernels 2.6.28 and later.
415 Using non-privileged source ports helps increase the maximum number of
416 NFS mount points allowed on a client, but NFS servers must be configured
417 to allow clients to connect via non-privileged source ports.
419 Refer to the SECURITY CONSIDERATIONS section for important details.
421 .BI lookupcache= mode
422 Specifies how the kernel manages its cache of directory entries
423 for a given mount point.
431 This option is supported in kernels 2.6.28 and later.
433 The Linux NFS client caches the result of all NFS LOOKUP requests.
434 If the requested directory entry exists on the server,
435 the result is referred to as
437 If the requested directory entry does not exist on the server,
438 the result is referred to as
441 If this option is not specified, or if
443 is specified, the client assumes both types of directory cache entries
444 are valid until their parent directory's cached attributes expire.
447 .BR pos " or " positive
448 is specified, the client assumes positive entries are valid
449 until their parent directory's cached attributes expire, but
450 always revalidates negative entires before an application
456 the client revalidates both types of directory cache entries
457 before an application can use them.
458 This permits quick detection of files that were created or removed
459 by other clients, but can impact application and server performance.
461 The DATA AND METADATA COHERENCE section contains a
462 detailed discussion of these trade-offs.
463 .SS "Options for NFS versions 2 and 3 only"
464 Use these options, along with the options in the above subsection,
465 for NFS versions 2 and 3 only.
468 The transport protocol name and protocol family the NFS client uses
469 to transmit requests to the NFS server for this mount point.
470 If an NFS server has both an IPv4 and an IPv6 address, using a specific
471 netid will force the use of IPv4 or IPv6 networking to communicate
474 If support for TI-RPC is built into the
478 is a valid netid listed in
480 The value "rdma" may also be specified.
483 command does not have TI-RPC support, then
485 is one of "tcp," "udp," or "rdma," and only IPv4 may be used.
487 Each transport protocol uses different default
492 Refer to the description of these two mount options for details.
494 In addition to controlling how the NFS client transmits requests to
495 the server, this mount option also controls how the
497 command communicates with the server's rpcbind and mountd services.
498 Specifying a netid that uses TCP forces all traffic from the
500 command and the NFS client to use TCP.
501 Specifying a netid that uses UDP forces all traffic types to use UDP.
505 mount option is not specified, the
507 command discovers which protocols the server supports
508 and chooses an appropriate transport for each service.
509 Refer to the TRANSPORT METHODS section for more details.
514 option is an alternative to specifying
516 It is included for compatibility with other operating systems.
521 option is an alternative to specifying
523 It is included for compatibility with other operating systems.
528 option is an alternative to specifying
532 The numeric value of the server's NFS service port.
533 If the server's NFS service is not available on the specified port,
534 the mount request fails.
536 If this option is not specified, or if the specified port value is 0,
537 then the NFS client uses the NFS service port number
538 advertised by the server's rpcbind service.
539 The mount request fails if the server's rpcbind service is not available,
540 the server's NFS service is not registered with its rpcbind service,
541 or the server's NFS service is not available on the advertised port.
544 The numeric value of the server's mountd port.
545 If the server's mountd service is not available on the specified port,
546 the mount request fails.
548 If this option is not specified,
549 or if the specified port value is 0, then the
551 command uses the mountd service port number
552 advertised by the server's rpcbind service.
553 The mount request fails if the server's rpcbind service is not available,
554 the server's mountd service is not registered with its rpcbind service,
555 or the server's mountd service is not available on the advertised port.
557 This option can be used when mounting an NFS server
558 through a firewall that blocks the rpcbind protocol.
560 .BI mountproto= netid
561 The transport protocol name and protocol family the NFS client uses
562 to transmit requests to the NFS server's mountd service when performing
563 this mount request, and when later unmounting this mount point.
565 If support for TI-RPC is built into the
569 is a valid netid listed in
573 is one of "tcp" or "udp," and only IPv4 may be used.
575 This option can be used when mounting an NFS server
576 through a firewall that blocks a particular transport.
577 When used in combination with the
579 option, different transports for mountd requests and NFS requests
581 If the server's mountd service is not available via the specified
582 transport, the mount request fails.
584 Refer to the TRANSPORT METHODS section for more on how the
586 mount option interacts with the
591 The hostname of the host running mountd.
592 If this option is not specified, the
594 command assumes that the mountd service runs
595 on the same host as the NFS service.
598 The RPC version number used to contact the server's mountd.
599 If this option is not specified, the client uses a version number
600 appropriate to the requested NFS version.
601 This option is useful when multiple NFS services
602 are running on the same remote server host.
605 The maximum length of a pathname component on this mount.
606 If this option is not specified, the maximum length is negotiated
607 with the server. In most cases, this maximum length is 255 characters.
609 Some early versions of NFS did not support this negotiation.
610 Using this option ensures that
612 reports the proper maximum component length to applications
616 The NFS protocol version number used to contact the server's NFS service.
617 If the server does not support the requested version, the mount request fails.
618 If this option is not specified, the client negotiates a suitable version with
619 the server, trying version 4 first, version 3 second, and version 2 last.
622 This option is an alternative to the
625 It is included for compatibility with other operating systems.
627 .BR lock " / " nolock
628 Selects whether to use the NLM sideband protocol to lock files on the server.
629 If neither option is specified (or if
631 is specified), NLM locking is used for this mount point.
634 option, applications can lock files,
635 but such locks provide exclusion only against other applications
636 running on the same client.
637 Remote applications are not affected by these locks.
639 NLM locking must be disabled with the
641 option when using NFS to mount
645 contains files used by the NLM implementation on Linux.
648 option is also required when mounting exports on NFS servers
649 that do not support the NLM protocol.
651 .BR intr " / " nointr
652 Selects whether to allow signals to interrupt file operations
653 on this mount point. If neither option
657 signals do not interrupt NFS file operations. If
659 is specified, system calls return EINTR if an in-progress NFS operation is interrupted by
664 option is preferred to using the
666 option because it is significantly less likely to result in data corruption.
669 .BR intr " / " nointr
670 mount option is deprecated after kernel 2.6.25.
671 Only SIGKILL can interrupt a pending NFS operation on these kernels,
672 and if specified, this mount option is ignored to provide backwards
673 compatibility with older kernels.
676 Selects whether to use close-to-open cache coherence semantics.
677 If neither option is specified (or if
679 is specified), the client uses close-to-open
680 cache coherence semantics. If the
682 option is specified, the client uses a non-standard heuristic to determine when
683 files on the server have changed.
687 option may improve performance for read-only mounts,
688 but should be used only if the data on the server changes only occasionally.
689 The DATA AND METADATA COHERENCE section discusses the behavior
690 of this option in more detail.
693 Selects whether to use the NFSACL sideband protocol on this mount point.
694 The NFSACL sideband protocol is a proprietary protocol
695 implemented in Solaris that manages Access Control Lists. NFSACL was never
696 made a standard part of the NFS protocol specification.
703 the NFS client negotiates with the server
704 to see if the NFSACL protocol is supported,
705 and uses it if the server supports it.
706 Disabling the NFSACL sideband protocol may be necessary
707 if the negotiation causes problems on the client or server.
708 Refer to the SECURITY CONSIDERATIONS section for more details.
710 .BR rdirplus " / " nordirplus
711 Selects whether to use NFS version 3 READDIRPLUS requests.
712 If this option is not specified, the NFS client uses READDIRPLUS requests
713 on NFS version 3 mounts to read small directories.
714 Some applications perform better if the client uses only READDIR requests
717 .BR local_lock= mechanism
718 Specifies whether to use local locking for any or both of the flock and the
719 POSIX locking mechanisms.
727 This option is supported in kernels 2.6.37 and later.
729 The Linux NFS client provides a way to make locks local. This means, the
730 applications can lock files, but such locks provide exclusion only against
731 other applications running on the same client. Remote applications are not
732 affected by these locks.
734 If this option is not specified, or if
736 is specified, the client assumes that the locks are not local.
740 is specified, the client assumes that both flock and POSIX locks are local.
744 is specified, the client assumes that only flock locks are local and uses
745 NLM sideband protocol to lock files when POSIX locks are used.
749 is specified, the client assumes that POSIX locks are local and uses NLM
750 sideband protocol to lock files when flock locks are used.
752 To support legacy flock behavior similar to that of NFS clients < 2.6.12,
753 use 'local_lock=flock'. This option is required when exporting NFS mounts via
754 Samba as Samba maps Windows share mode locks as flock. Since NFS clients >
755 2.6.12 implement flock by emulating POSIX locks, this will result in
758 NOTE: When used together, the 'local_lock' mount option will be overridden
759 by 'nolock'/'lock' mount option.
760 .SS "Options for NFS version 4 only"
761 Use these options, along with the options in the first subsection above,
762 for NFS version 4 and newer.
765 The transport protocol name and protocol family the NFS client uses
766 to transmit requests to the NFS server for this mount point.
767 If an NFS server has both an IPv4 and an IPv6 address, using a specific
768 netid will force the use of IPv4 or IPv6 networking to communicate
771 If support for TI-RPC is built into the
775 is a valid netid listed in
779 is one of "tcp" or "udp," and only IPv4 may be used.
781 All NFS version 4 servers are required to support TCP,
782 so if this mount option is not specified, the NFS version 4 client
783 uses the TCP protocol.
784 Refer to the TRANSPORT METHODS section for more details.
787 The numeric value of the server's NFS service port.
788 If the server's NFS service is not available on the specified port,
789 the mount request fails.
791 If this mount option is not specified,
792 the NFS client uses the standard NFS port number of 2049
793 without first checking the server's rpcbind service.
794 This allows an NFS version 4 client to contact an NFS version 4
795 server through a firewall that may block rpcbind requests.
797 If the specified port value is 0,
798 then the NFS client uses the NFS service port number
799 advertised by the server's rpcbind service.
800 The mount request fails if the server's rpcbind service is not available,
801 the server's NFS service is not registered with its rpcbind service,
802 or the server's NFS service is not available on the advertised port.
804 .BR intr " / " nointr
805 Selects whether to allow signals to interrupt file operations
806 on this mount point. If neither option is specified (or if
808 is specified), system calls return EINTR if an in-progress NFS operation
809 is interrupted by a signal. If
811 is specified, signals do not
812 interrupt NFS operations.
816 option is preferred to using the
818 option because it is significantly less likely to result in data corruption.
821 .BR intr " / " nointr
822 mount option is deprecated after kernel 2.6.25.
823 Only SIGKILL can interrupt a pending NFS operation on these kernels,
824 and if specified, this mount option is ignored to provide backwards
825 compatibility with older kernels.
828 Selects whether to use close-to-open cache coherence semantics
829 for NFS directories on this mount point.
835 the default is to use close-to-open cache coherence
836 semantics for directories.
838 File data caching behavior is not affected by this option.
839 The DATA AND METADATA COHERENCE section discusses
840 the behavior of this option in more detail.
842 .BI clientaddr= n.n.n.n
843 Specifies a single IPv4 address (in dotted-quad form),
844 or a non-link-local IPv6 address,
845 that the NFS client advertises to allow servers
846 to perform NFS version 4 callback requests against
847 files on this mount point. If the server is unable to
848 establish callback connections to clients, performance
849 may degrade, or accesses to files may temporarily hang.
851 If this option is not specified, the
853 command attempts to discover an appropriate callback address automatically.
854 The automatic discovery process is not perfect, however.
855 In the presence of multiple client network interfaces,
856 special routing policies,
857 or atypical network topologies,
858 the exact address to use for callbacks may be nontrivial to determine.
859 .SH nfs4 FILE SYSTEM TYPE
862 file system type is an old syntax for specifying NFSv4 usage. It can still
863 be used with all NFSv4-specific and common options, excepted the
866 .SH MOUNT CONFIGURATION FILE
867 If the mount command is configured to do so, all of the mount options
868 described in the previous section can also be configured in the
869 .I /etc/nfsmount.conf
874 To mount an export using NFS version 2,
877 file system type and specify the
880 To mount using NFS version 3,
883 file system type and specify the
886 To mount using NFS version 4,
889 file system type, with the
895 The following example from an
897 file causes the mount command to negotiate
898 reasonable defaults for NFS behavior.
901 .ta 8n +16n +6n +6n +30n
902 server:/export /mnt nfs defaults 0 0
905 Here is an example from an /etc/fstab file for an NFS version 2 mount over UDP.
908 .ta 8n +16n +6n +6n +30n
909 server:/export /mnt nfs nfsvers=2,proto=udp 0 0
912 Try this example to mount using NFS version 4 over TCP
913 with Kerberos 5 mutual authentication.
916 .ta 8n +16n +6n +6n +30n
917 server:/export /mnt nfs4 sec=krb5 0 0
920 This example can be used to mount /usr over NFS.
923 .ta 8n +16n +6n +6n +30n
924 server:/export /usr nfs ro,nolock,nocto,actimeo=3600 0 0
927 This example shows how to mount an NFS server
928 using a raw IPv6 link-local address.
931 .ta 8n +40n +5n +4n +9n
932 [fe80::215:c5ff:fb3e:e2b1%eth0]:/export /mnt nfs defaults 0 0
934 .SH "TRANSPORT METHODS"
935 NFS clients send requests to NFS servers via
936 Remote Procedure Calls, or
938 The RPC client discovers remote service endpoints automatically,
939 handles per-request authentication,
940 adjusts request parameters for different byte endianness on client and server,
941 and retransmits requests that may have been lost by the network or server.
942 RPC requests and replies flow over a network transport.
946 command, NFS client, and NFS server
947 can automatically negotiate proper transport
948 and data transfer size settings for a mount point.
949 In some cases, however, it pays to specify
950 these settings explicitly using mount options.
952 Traditionally, NFS clients used the UDP transport exclusively for
953 transmitting requests to servers. Though its implementation is
954 simple, NFS over UDP has many limitations that prevent smooth
955 operation and good performance in some common deployment
956 environments. Even an insignificant packet loss rate results in the
957 loss of whole NFS requests; as such, retransmit timeouts are usually
958 in the subsecond range to allow clients to recover quickly from
959 dropped requests, but this can result in extraneous network traffic
962 However, UDP can be quite effective in specialized settings where
963 the networks MTU is large relative to NFSs data transfer size (such
964 as network environments that enable jumbo Ethernet frames). In such
965 environments, trimming the
969 settings so that each
970 NFS read or write request fits in just a few network frames (or even
971 in a single frame) is advised. This reduces the probability that
972 the loss of a single MTU-sized network frame results in the loss of
973 an entire large read or write request.
975 TCP is the default transport protocol used for all modern NFS
976 implementations. It performs well in almost every conceivable
977 network environment and provides excellent guarantees against data
978 corruption caused by network unreliability. TCP is often a
979 requirement for mounting a server through a network firewall.
981 Under normal circumstances, networks drop packets much more
982 frequently than NFS servers drop requests. As such, an aggressive
983 retransmit timeout setting for NFS over TCP is unnecessary. Typical
984 timeout settings for NFS over TCP are between one and ten minutes.
985 After the client exhausts its retransmits (the value of the
987 mount option), it assumes a network partition has occurred,
988 and attempts to reconnect to the server on a fresh socket. Since
989 TCP itself makes network data transfer reliable,
993 can safely be allowed to default to the largest values supported by
994 both client and server, independent of the network's MTU size.
995 .SS "Using the mountproto mount option"
996 This section applies only to NFS version 2 and version 3 mounts
997 since NFS version 4 does not use a separate protocol for mount
1000 The Linux NFS client can use a different transport for
1001 contacting an NFS server's rpcbind service, its mountd service,
1002 its Network Lock Manager (NLM) service, and its NFS service.
1003 The exact transports employed by the Linux NFS client for
1004 each mount point depends on the settings of the transport
1005 mount options, which include
1008 .BR udp ", and " tcp .
1010 The client sends Network Status Manager (NSM) notifications
1011 via UDP no matter what transport options are specified, but
1012 listens for server NSM notifications on both UDP and TCP.
1013 The NFS Access Control List (NFSACL) protocol shares the same
1014 transport as the main NFS service.
1016 If no transport options are specified, the Linux NFS client
1017 uses UDP to contact the server's mountd service, and TCP to
1018 contact its NLM and NFS services by default.
1020 If the server does not support these transports for these services, the
1022 command attempts to discover what the server supports, and then retries
1023 the mount request once using the discovered transports.
1024 If the server does not advertise any transport supported by the client
1025 or is misconfigured, the mount request fails.
1028 option is in effect, the mount command backgrounds itself and continues
1029 to attempt the specified mount request.
1037 option is specified but the
1039 option is not, the specified transport is used to contact
1040 both the server's mountd service and for the NLM and NFS services.
1044 option is specified but none of the
1045 .BR proto ", " udp " or " tcp
1046 options are specified, then the specified transport is used for the
1047 initial mountd request, but the mount command attempts to discover
1048 what the server supports for the NFS protocol, preferring TCP if
1049 both transports are supported.
1052 .BR mountproto " and " proto
1054 .BR udp " or " tcp )
1055 options are specified, then the transport specified by the
1057 option is used for the initial mountd request, and the transport
1061 .BR udp " or " tcp " options)"
1062 is used for NFS, no matter what order these options appear.
1063 No automatic service discovery is performed if these options are
1067 .BR proto ", " udp ", " tcp ", "
1070 options are specified more than once on the same mount command line,
1071 then the value of the rightmost instance of each of these options
1073 .SH "DATA AND METADATA COHERENCE"
1074 Some modern cluster file systems provide
1075 perfect cache coherence among their clients.
1076 Perfect cache coherence among disparate NFS clients
1077 is expensive to achieve, especially on wide area networks.
1078 As such, NFS settles for weaker cache coherence that
1079 satisfies the requirements of most file sharing types. Normally,
1080 file sharing is completely sequential:
1081 first client A opens a file, writes something to it, then closes it;
1082 then client B opens the same file, and reads the changes.
1084 .SS "Close-to-open cache consistency"
1085 When an application opens a file stored on an NFS server,
1086 the NFS client checks that it still exists on the server
1087 and is permitted to the opener by sending a GETATTR or ACCESS request.
1088 When the application closes the file,
1089 the NFS client writes back any pending changes
1090 to the file so that the next opener can view the changes.
1091 This also gives the NFS client an opportunity to report
1092 any server write errors to the application
1093 via the return code from
1095 The behavior of checking at open time and flushing at close time
1096 is referred to as close-to-open cache consistency.
1097 .SS "Weak cache consistency"
1098 There are still opportunities for a client's data cache
1099 to contain stale data.
1100 The NFS version 3 protocol introduced "weak cache consistency"
1101 (also known as WCC) which provides a way of efficiently checking
1102 a file's attributes before and after a single request.
1103 This allows a client to help identify changes
1104 that could have been made by other clients.
1106 When a client is using many concurrent operations
1107 that update the same file at the same time
1108 (for example, during asynchronous write behind),
1109 it is still difficult to tell whether it was
1110 that client's updates or some other client's updates
1111 that altered the file.
1112 .SS "Attribute caching"
1115 mount option to achieve attribute cache coherence
1116 among multiple clients.
1117 Almost every file system operation checks
1118 file attribute information.
1119 The client keeps this information cached
1120 for a period of time to reduce network and server load.
1123 is in effect, a client's file attribute cache is disabled,
1124 so each operation that needs to check a file's attributes
1125 is forced to go back to the server.
1126 This permits a client to see changes to a file very quickly,
1127 at the cost of many extra network operations.
1129 Be careful not to confuse the
1131 option with "no data caching."
1134 mount option prevents the client from caching file metadata,
1135 but there are still races that may result in data cache incoherence
1136 between client and server.
1138 The NFS protocol is not designed to support
1139 true cluster file system cache coherence
1140 without some type of application serialization.
1141 If absolute cache coherence among clients is required,
1142 applications should use file locking. Alternatively, applications
1143 can also open their files with the O_DIRECT flag
1144 to disable data caching entirely.
1145 .SS "Directory entry caching"
1146 The Linux NFS client caches the result of all NFS LOOKUP requests.
1147 If the requested directory entry exists on the server,
1148 the result is referred to as a
1149 .IR positive " lookup result.
1150 If the requested directory entry does not exist on the server
1151 (that is, the server returned ENOENT),
1152 the result is referred to as
1153 .IR negative " lookup result.
1155 To detect when directory entries have been added or removed
1157 the Linux NFS client watches a directory's mtime.
1158 If the client detects a change in a directory's mtime,
1159 the client drops all cached LOOKUP results for that directory.
1160 Since the directory's mtime is a cached attribute, it may
1161 take some time before a client notices it has changed.
1162 See the descriptions of the
1163 .BR acdirmin ", " acdirmax ", and " noac
1164 mount options for more information about
1165 how long a directory's mtime is cached.
1167 Caching directory entries improves the performance of applications that
1168 do not share files with applications on other clients.
1169 Using cached information about directories can interfere
1170 with applications that run concurrently on multiple clients and
1171 need to detect the creation or removal of files quickly, however.
1174 mount option allows some tuning of directory entry caching behavior.
1176 Before kernel release 2.6.28,
1177 the Linux NFS client tracked only positive lookup results.
1178 This permitted applications to detect new directory entries
1179 created by other clients quickly while still providing some of the
1180 performance benefits of caching.
1181 If an application depends on the previous lookup caching behavior
1182 of the Linux NFS client, you can use
1183 .BR lookupcache=positive .
1185 If the client ignores its cache and validates every application
1186 lookup request with the server,
1187 that client can immediately detect when a new directory
1188 entry has been either created or removed by another client.
1189 You can specify this behavior using
1190 .BR lookupcache=none .
1191 The extra NFS requests needed if the client does not
1192 cache directory entries can exact a performance penalty.
1193 Disabling lookup caching
1194 should result in less of a performance penalty than using
1196 and has no effect on how the NFS client caches the attributes of files.
1198 .SS "The sync mount option"
1199 The NFS client treats the
1201 mount option differently than some other file systems
1204 for a description of the generic
1213 is specified (or if the
1215 option is specified),
1216 the NFS client delays sending application
1217 writes to the server
1218 until any of these events occur:
1220 Memory pressure forces reclamation of system memory resources.
1222 An application flushes file data explicitly with
1228 An application closes a file with
1231 The file is locked/unlocked via
1234 In other words, under normal circumstances,
1235 data written by an application may not immediately appear
1236 on the server that hosts the file.
1240 option is specified on a mount point,
1241 any system call that writes data to files on that mount point
1242 causes that data to be flushed to the server
1243 before the system call returns control to user space.
1244 This provides greater data cache coherence among clients,
1245 but at a significant performance cost.
1247 Applications can use the O_SYNC open flag to force application
1248 writes to individual files to go to the server immediately without
1252 .SS "Using file locks with NFS"
1253 The Network Lock Manager protocol is a separate sideband protocol
1254 used to manage file locks in NFS version 2 and version 3.
1255 To support lock recovery after a client or server reboot,
1256 a second sideband protocol --
1257 known as the Network Status Manager protocol --
1260 file locking is supported directly in the main NFS protocol,
1261 and the NLM and NSM sideband protocols are not used.
1263 In most cases, NLM and NSM services are started automatically,
1264 and no extra configuration is required.
1265 Configure all NFS clients with fully-qualified domain names
1266 to ensure that NFS servers can find clients to notify them of server reboots.
1268 NLM supports advisory file locks only.
1269 To lock NFS files, use
1271 with the F_GETLK and F_SETLK commands.
1272 The NFS client converts file locks obtained via
1276 When mounting servers that do not support the NLM protocol,
1277 or when mounting an NFS server through a firewall
1278 that blocks the NLM service port,
1281 mount option. NLM locking must be disabled with the
1283 option when using NFS to mount
1287 contains files used by the NLM implementation on Linux.
1291 option may also be advised to improve the performance
1292 of a proprietary application which runs on a single client
1293 and uses file locks extensively.
1294 .SS "NFS version 4 caching features"
1295 The data and metadata caching behavior of NFS version 4
1296 clients is similar to that of earlier versions.
1297 However, NFS version 4 adds two features that improve
1299 .I change attributes
1301 .IR "file delegation" .
1305 is a new part of NFS file and directory metadata
1306 which tracks data changes.
1307 It replaces the use of a file's modification
1308 and change time stamps
1309 as a way for clients to validate the content
1311 Change attributes are independent of the time stamp
1312 resolution on either the server or client, however.
1316 is a contract between an NFS version 4 client
1317 and server that allows the client to treat a file temporarily
1318 as if no other client is accessing it.
1319 The server promises to notify the client (via a callback request) if another client
1320 attempts to access that file.
1321 Once a file has been delegated to a client, the client can
1322 cache that file's data and metadata aggressively without
1323 contacting the server.
1325 File delegations come in two flavors:
1331 delegation means that the server notifies the client
1332 about any other clients that want to write to the file.
1335 delegation means that the client gets notified about
1336 either read or write accessors.
1338 Servers grant file delegations when a file is opened,
1339 and can recall delegations at any time when another
1340 client wants access to the file that conflicts with
1341 any delegations already granted.
1342 Delegations on directories are not supported.
1344 In order to support delegation callback, the server
1345 checks the network return path to the client during
1346 the client's initial contact with the server.
1347 If contact with the client cannot be established,
1348 the server simply does not grant any delegations to
1350 .SH "SECURITY CONSIDERATIONS"
1351 NFS servers control access to file data,
1352 but they depend on their RPC implementation
1353 to provide authentication of NFS requests.
1354 Traditional NFS access control mimics
1355 the standard mode bit access control provided in local file systems.
1356 Traditional RPC authentication uses a number
1357 to represent each user
1358 (usually the user's own uid),
1359 a number to represent the user's group (the user's gid),
1360 and a set of up to 16 auxiliary group numbers
1361 to represent other groups of which the user may be a member.
1363 Typically, file data and user ID values appear unencrypted
1364 (i.e. "in the clear") on the network.
1365 Moreover, NFS versions 2 and 3 use
1366 separate sideband protocols for mounting,
1367 locking and unlocking files,
1368 and reporting system status of clients and servers.
1369 These auxiliary protocols use no authentication.
1371 In addition to combining these sideband protocols with the main NFS protocol,
1372 NFS version 4 introduces more advanced forms of access control,
1373 authentication, and in-transit data protection.
1374 The NFS version 4 specification mandates NFSv4 ACLs,
1375 RPCGSS authentication, and RPCGSS security flavors
1376 that provide per-RPC integrity checking and encryption.
1377 Because NFS version 4 combines the
1378 function of the sideband protocols into the main NFS protocol,
1379 the new security features apply to all NFS version 4 operations
1380 including mounting, file locking, and so on.
1381 RPCGSS authentication can also be used with NFS versions 2 and 3,
1382 but does not protect their sideband protocols.
1386 mount option specifies the RPCGSS security mode
1387 that is in effect on a given NFS mount point.
1390 provides cryptographic proof of a user's identity in each RPC request.
1391 This provides strong verification of the identity of users
1392 accessing data on the server.
1393 Note that additional configuration besides adding this mount option
1394 is required in order to enable Kerberos security.
1397 man page for details.
1399 Two additional flavors of Kerberos security are supported:
1405 security flavor provides a cryptographically strong guarantee
1406 that the data in each RPC request has not been tampered with.
1409 security flavor encrypts every RPC request
1410 to prevent data exposure during network transit; however,
1411 expect some performance impact
1412 when using integrity checking or encryption.
1413 Similar support for other forms of cryptographic security
1416 The NFS version 4 protocol allows
1417 clients and servers to negotiate among multiple security flavors
1418 during mount processing.
1419 However, Linux does not yet implement such negotiation.
1420 The Linux client specifies a single security flavor at mount time
1421 which remains in effect for the lifetime of the mount.
1422 If the server does not support this flavor,
1423 the initial mount request is rejected by the server.
1424 .SS "Using non-privileged source ports"
1425 NFS clients usually communicate with NFS servers via network sockets.
1426 Each end of a socket is assigned a port value, which is simply a number
1427 between 1 and 65535 that distinguishes socket endpoints at the same
1429 A socket is uniquely defined by a tuple that includes the transport
1430 protocol (TCP or UDP) and the port values and IP addresses of both
1433 The NFS client can choose any source port value for its sockets,
1434 but usually chooses a
1437 A privileged port is a port value less than 1024.
1438 Only a process with root privileges may create a socket
1439 with a privileged source port.
1441 The exact range of privileged source ports that can be chosen is
1442 set by a pair of sysctls to avoid choosing a well-known port, such as
1443 the port used by ssh.
1444 This means the number of source ports available for the NFS client,
1445 and therefore the number of socket connections that can be used
1447 is practically limited to only a few hundred.
1449 As described above, the traditional default NFS authentication scheme,
1450 known as AUTH_SYS, relies on sending local UID and GID numbers to identify
1451 users making NFS requests.
1452 An NFS server assumes that if a connection comes from a privileged port,
1453 the UID and GID numbers in the NFS requests on this connection have been
1454 verified by the client's kernel or some other local authority.
1455 This is an easy system to spoof, but on a trusted physical network between
1456 trusted hosts, it is entirely adequate.
1458 Roughly speaking, one socket is used for each NFS mount point.
1459 If a client could use non-privileged source ports as well,
1460 the number of sockets allowed,
1461 and thus the maximum number of concurrent mount points,
1462 would be much larger.
1464 Using non-privileged source ports may compromise server security somewhat,
1465 since any user on AUTH_SYS mount points can now pretend to be any other
1466 when making NFS requests.
1467 Thus NFS servers do not support this by default.
1468 They explicitly allow it usually via an export option.
1470 To retain good security while allowing as many mount points as possible,
1471 it is best to allow non-privileged client connections only if the server
1472 and client both require strong authentication, such as Kerberos.
1473 .SS "Mounting through a firewall"
1474 A firewall may reside between an NFS client and server,
1475 or the client or server may block some of its own ports via IP
1477 It is still possible to mount an NFS server through a firewall,
1480 command's automatic service endpoint discovery mechanisms may not work; this
1481 requires you to provide specific endpoint details via NFS mount options.
1483 NFS servers normally run a portmapper or rpcbind daemon to advertise
1484 their service endpoints to clients. Clients use the rpcbind daemon to determine:
1486 What network port each RPC-based service is using
1488 What transport protocols each RPC-based service supports
1490 The rpcbind daemon uses a well-known port number (111) to help clients find a service endpoint.
1491 Although NFS often uses a standard port number (2049),
1492 auxiliary services such as the NLM service can choose
1493 any unused port number at random.
1495 Common firewall configurations block the well-known rpcbind port.
1496 In the absense of an rpcbind service,
1497 the server administrator fixes the port number
1498 of NFS-related services so that the firewall
1499 can allow access to specific NFS service ports.
1500 Client administrators then specify the port number
1501 for the mountd service via the
1506 It may also be necessary to enforce the use of TCP or UDP
1507 if the firewall blocks one of those transports.
1508 .SS "NFS Access Control Lists"
1509 Solaris allows NFS version 3 clients direct access
1510 to POSIX Access Control Lists stored in its local file systems.
1511 This proprietary sideband protocol, known as NFSACL,
1512 provides richer access control than mode bits.
1513 Linux implements this protocol
1514 for compatibility with the Solaris NFS implementation.
1515 The NFSACL protocol never became a standard part
1516 of the NFS version 3 specification, however.
1518 The NFS version 4 specification mandates a new version
1519 of Access Control Lists that are semantically richer than POSIX ACLs.
1520 NFS version 4 ACLs are not fully compatible with POSIX ACLs; as such,
1521 some translation between the two is required
1522 in an environment that mixes POSIX ACLs and NFS version 4.
1523 .SH "THE REMOUNT OPTION"
1524 Generic mount options such as
1526 can be modified on NFS mount points using the
1531 for more information on generic mount options.
1533 With few exceptions, NFS-specific options
1534 are not able to be modified during a remount.
1535 The underlying transport or NFS version
1536 cannot be changed by a remount, for example.
1538 Performing a remount on an NFS file system mounted with the
1540 option may have unintended consequences.
1543 option is a combination of the generic option
1545 and the NFS-specific option
1547 .SS "Unmounting after a remount"
1548 For mount points that use NFS versions 2 or 3, the NFS umount subcommand
1549 depends on knowing the original set of mount options used to perform the
1551 These options are stored on disk by the NFS mount subcommand,
1552 and can be erased by a remount.
1554 To ensure that the saved mount options are not erased during a remount,
1555 specify either the local mount directory, or the server hostname and
1556 export pathname, but not both, during a remount. For example,
1560 mount -o remount,ro /mnt
1563 merges the mount option
1565 with the mount options already saved on disk for the NFS server mounted at /mnt.
1571 Before 2.4.7, the Linux NFS client did not support NFS over TCP.
1573 Before 2.4.20, the Linux NFS client used a heuristic
1574 to determine whether cached file data was still valid
1575 rather than using the standard close-to-open cache coherency method
1578 Starting with 2.4.22, the Linux NFS client employs
1579 a Van Jacobsen-based RTT estimator to determine retransmit
1580 timeout values when using NFS over UDP.
1582 Before 2.6.0, the Linux NFS client did not support NFS version 4.
1584 Before 2.6.8, the Linux NFS client used only synchronous reads and writes
1586 .BR rsize " and " wsize
1587 settings were smaller than the system's page size.
1589 The Linux NFS client does not yet support
1590 certain optional features of the NFS version 4 protocol,
1591 such as security negotiation, server referrals, and named attributes.
1606 .BR rpc.svcgssd (8),
1609 RFC 768 for the UDP specification.
1611 RFC 793 for the TCP specification.
1613 RFC 1094 for the NFS version 2 specification.
1615 RFC 1813 for the NFS version 3 specification.
1617 RFC 1832 for the XDR specification.
1619 RFC 1833 for the RPC bind specification.
1621 RFC 2203 for the RPCSEC GSS API protocol specification.
1623 RFC 3530 for the NFS version 4 specification.