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
383 Refer to the SECURITY CONSIDERATIONS section for details.
385 .BR sharecache " / " nosharecache
386 Determines how the client's data cache and attribute cache are shared
387 when mounting the same export more than once concurrently. Using the
388 same cache reduces memory requirements on the client and presents
389 identical file contents to applications when the same remote file is
390 accessed via different mount points.
392 If neither option is specified, or if the
395 specified, then a single cache is used for all mount points that
396 access the same export. If the
399 then that mount point gets a unique cache. Note that when data and
400 attribute caches are shared, the mount options from the first mount
401 point take effect for subsequent concurrent mounts of the same export.
403 As of kernel 2.6.18, the behavior specified by
405 is legacy caching behavior. This
406 is considered a data risk since multiple cached copies
407 of the same file on the same client can become out of sync
408 following a local update of one of the copies.
410 .BR resvport " / " noresvport
411 Specifies whether the NFS client should use a privileged source port
412 when communicating with an NFS server for this mount point.
413 If this option is not specified, or the
415 option is specified, the NFS client uses a privileged source port.
418 option is specified, the NFS client uses a non-privileged source port.
419 This option is supported in kernels 2.6.28 and later.
421 Using non-privileged source ports helps increase the maximum number of
422 NFS mount points allowed on a client, but NFS servers must be configured
423 to allow clients to connect via non-privileged source ports.
425 Refer to the SECURITY CONSIDERATIONS section for important details.
427 .BI lookupcache= mode
428 Specifies how the kernel manages its cache of directory entries
429 for a given mount point.
437 This option is supported in kernels 2.6.28 and later.
439 The Linux NFS client caches the result of all NFS LOOKUP requests.
440 If the requested directory entry exists on the server,
441 the result is referred to as
443 If the requested directory entry does not exist on the server,
444 the result is referred to as
447 If this option is not specified, or if
449 is specified, the client assumes both types of directory cache entries
450 are valid until their parent directory's cached attributes expire.
453 .BR pos " or " positive
454 is specified, the client assumes positive entries are valid
455 until their parent directory's cached attributes expire, but
456 always revalidates negative entires before an application
462 the client revalidates both types of directory cache entries
463 before an application can use them.
464 This permits quick detection of files that were created or removed
465 by other clients, but can impact application and server performance.
467 The DATA AND METADATA COHERENCE section contains a
468 detailed discussion of these trade-offs.
469 .SS "Options for NFS versions 2 and 3 only"
470 Use these options, along with the options in the above subsection,
471 for NFS versions 2 and 3 only.
474 The transport protocol name and protocol family the NFS client uses
475 to transmit requests to the NFS server for this mount point.
476 If an NFS server has both an IPv4 and an IPv6 address, using a specific
477 netid will force the use of IPv4 or IPv6 networking to communicate
480 If support for TI-RPC is built into the
484 is a valid netid listed in
486 The value "rdma" may also be specified.
489 command does not have TI-RPC support, then
491 is one of "tcp," "udp," or "rdma," and only IPv4 may be used.
493 Each transport protocol uses different default
498 Refer to the description of these two mount options for details.
500 In addition to controlling how the NFS client transmits requests to
501 the server, this mount option also controls how the
503 command communicates with the server's rpcbind and mountd services.
504 Specifying a netid that uses TCP forces all traffic from the
506 command and the NFS client to use TCP.
507 Specifying a netid that uses UDP forces all traffic types to use UDP.
511 mount option is not specified, the
513 command discovers which protocols the server supports
514 and chooses an appropriate transport for each service.
515 Refer to the TRANSPORT METHODS section for more details.
520 option is an alternative to specifying
522 It is included for compatibility with other operating systems.
527 option is an alternative to specifying
529 It is included for compatibility with other operating systems.
534 option is an alternative to specifying
538 The numeric value of the server's NFS service port.
539 If the server's NFS service is not available on the specified port,
540 the mount request fails.
542 If this option is not specified, or if the specified port value is 0,
543 then the NFS client uses the NFS service port number
544 advertised by the server's rpcbind service.
545 The mount request fails if the server's rpcbind service is not available,
546 the server's NFS service is not registered with its rpcbind service,
547 or the server's NFS service is not available on the advertised port.
550 The numeric value of the server's mountd port.
551 If the server's mountd service is not available on the specified port,
552 the mount request fails.
554 If this option is not specified,
555 or if the specified port value is 0, then the
557 command uses the mountd service port number
558 advertised by the server's rpcbind service.
559 The mount request fails if the server's rpcbind service is not available,
560 the server's mountd service is not registered with its rpcbind service,
561 or the server's mountd service is not available on the advertised port.
563 This option can be used when mounting an NFS server
564 through a firewall that blocks the rpcbind protocol.
566 .BI mountproto= netid
567 The transport protocol name and protocol family the NFS client uses
568 to transmit requests to the NFS server's mountd service when performing
569 this mount request, and when later unmounting this mount point.
571 If support for TI-RPC is built into the
575 is a valid netid listed in
579 is one of "tcp" or "udp," and only IPv4 may be used.
581 This option can be used when mounting an NFS server
582 through a firewall that blocks a particular transport.
583 When used in combination with the
585 option, different transports for mountd requests and NFS requests
587 If the server's mountd service is not available via the specified
588 transport, the mount request fails.
590 Refer to the TRANSPORT METHODS section for more on how the
592 mount option interacts with the
597 The hostname of the host running mountd.
598 If this option is not specified, the
600 command assumes that the mountd service runs
601 on the same host as the NFS service.
604 The RPC version number used to contact the server's mountd.
605 If this option is not specified, the client uses a version number
606 appropriate to the requested NFS version.
607 This option is useful when multiple NFS services
608 are running on the same remote server host.
611 The maximum length of a pathname component on this mount.
612 If this option is not specified, the maximum length is negotiated
613 with the server. In most cases, this maximum length is 255 characters.
615 Some early versions of NFS did not support this negotiation.
616 Using this option ensures that
618 reports the proper maximum component length to applications
622 The NFS protocol version number used to contact the server's NFS service.
623 If the server does not support the requested version, the mount request fails.
624 If this option is not specified, the client negotiates a suitable version with
625 the server, trying version 4 first, version 3 second, and version 2 last.
628 This option is an alternative to the
631 It is included for compatibility with other operating systems.
633 .BR lock " / " nolock
634 Selects whether to use the NLM sideband protocol to lock files on the server.
635 If neither option is specified (or if
637 is specified), NLM locking is used for this mount point.
640 option, applications can lock files,
641 but such locks provide exclusion only against other applications
642 running on the same client.
643 Remote applications are not affected by these locks.
645 NLM locking must be disabled with the
647 option when using NFS to mount
651 contains files used by the NLM implementation on Linux.
654 option is also required when mounting exports on NFS servers
655 that do not support the NLM protocol.
657 .BR intr " / " nointr
658 Selects whether to allow signals to interrupt file operations
659 on this mount point. If neither option
663 signals do not interrupt NFS file operations. If
665 is specified, system calls return EINTR if an in-progress NFS operation is interrupted by
670 option is preferred to using the
672 option because it is significantly less likely to result in data corruption.
675 .BR intr " / " nointr
676 mount option is deprecated after kernel 2.6.25.
677 Only SIGKILL can interrupt a pending NFS operation on these kernels,
678 and if specified, this mount option is ignored to provide backwards
679 compatibility with older kernels.
682 Selects whether to use close-to-open cache coherence semantics.
683 If neither option is specified (or if
685 is specified), the client uses close-to-open
686 cache coherence semantics. If the
688 option is specified, the client uses a non-standard heuristic to determine when
689 files on the server have changed.
693 option may improve performance for read-only mounts,
694 but should be used only if the data on the server changes only occasionally.
695 The DATA AND METADATA COHERENCE section discusses the behavior
696 of this option in more detail.
699 Selects whether to use the NFSACL sideband protocol on this mount point.
700 The NFSACL sideband protocol is a proprietary protocol
701 implemented in Solaris that manages Access Control Lists. NFSACL was never
702 made a standard part of the NFS protocol specification.
709 the NFS client negotiates with the server
710 to see if the NFSACL protocol is supported,
711 and uses it if the server supports it.
712 Disabling the NFSACL sideband protocol may be necessary
713 if the negotiation causes problems on the client or server.
714 Refer to the SECURITY CONSIDERATIONS section for more details.
716 .BR rdirplus " / " nordirplus
717 Selects whether to use NFS version 3 READDIRPLUS requests.
718 If this option is not specified, the NFS client uses READDIRPLUS requests
719 on NFS version 3 mounts to read small directories.
720 Some applications perform better if the client uses only READDIR requests
723 .BR local_lock= mechanism
724 Specifies whether to use local locking for any or both of the flock and the
725 POSIX locking mechanisms.
733 This option is supported in kernels 2.6.37 and later.
735 The Linux NFS client provides a way to make locks local. This means, the
736 applications can lock files, but such locks provide exclusion only against
737 other applications running on the same client. Remote applications are not
738 affected by these locks.
740 If this option is not specified, or if
742 is specified, the client assumes that the locks are not local.
746 is specified, the client assumes that both flock and POSIX locks are local.
750 is specified, the client assumes that only flock locks are local and uses
751 NLM sideband protocol to lock files when POSIX locks are used.
755 is specified, the client assumes that POSIX locks are local and uses NLM
756 sideband protocol to lock files when flock locks are used.
758 To support legacy flock behavior similar to that of NFS clients < 2.6.12,
759 use 'local_lock=flock'. This option is required when exporting NFS mounts via
760 Samba as Samba maps Windows share mode locks as flock. Since NFS clients >
761 2.6.12 implement flock by emulating POSIX locks, this will result in
764 NOTE: When used together, the 'local_lock' mount option will be overridden
765 by 'nolock'/'lock' mount option.
766 .SS "Options for NFS version 4 only"
767 Use these options, along with the options in the first subsection above,
768 for NFS version 4 and newer.
771 The transport protocol name and protocol family the NFS client uses
772 to transmit requests to the NFS server for this mount point.
773 If an NFS server has both an IPv4 and an IPv6 address, using a specific
774 netid will force the use of IPv4 or IPv6 networking to communicate
777 If support for TI-RPC is built into the
781 is a valid netid listed in
785 is one of "tcp" or "udp," and only IPv4 may be used.
787 All NFS version 4 servers are required to support TCP,
788 so if this mount option is not specified, the NFS version 4 client
789 uses the TCP protocol.
790 Refer to the TRANSPORT METHODS section for more details.
793 The numeric value of the server's NFS service port.
794 If the server's NFS service is not available on the specified port,
795 the mount request fails.
797 If this mount option is not specified,
798 the NFS client uses the standard NFS port number of 2049
799 without first checking the server's rpcbind service.
800 This allows an NFS version 4 client to contact an NFS version 4
801 server through a firewall that may block rpcbind requests.
803 If the specified port value is 0,
804 then the NFS client uses the NFS service port number
805 advertised by the server's rpcbind service.
806 The mount request fails if the server's rpcbind service is not available,
807 the server's NFS service is not registered with its rpcbind service,
808 or the server's NFS service is not available on the advertised port.
810 .BR intr " / " nointr
811 Selects whether to allow signals to interrupt file operations
812 on this mount point. If neither option is specified (or if
814 is specified), system calls return EINTR if an in-progress NFS operation
815 is interrupted by a signal. If
817 is specified, signals do not
818 interrupt NFS operations.
822 option is preferred to using the
824 option because it is significantly less likely to result in data corruption.
827 .BR intr " / " nointr
828 mount option is deprecated after kernel 2.6.25.
829 Only SIGKILL can interrupt a pending NFS operation on these kernels,
830 and if specified, this mount option is ignored to provide backwards
831 compatibility with older kernels.
834 Selects whether to use close-to-open cache coherence semantics
835 for NFS directories on this mount point.
841 the default is to use close-to-open cache coherence
842 semantics for directories.
844 File data caching behavior is not affected by this option.
845 The DATA AND METADATA COHERENCE section discusses
846 the behavior of this option in more detail.
848 .BI clientaddr= n.n.n.n
849 Specifies a single IPv4 address (in dotted-quad form),
850 or a non-link-local IPv6 address,
851 that the NFS client advertises to allow servers
852 to perform NFS version 4 callback requests against
853 files on this mount point. If the server is unable to
854 establish callback connections to clients, performance
855 may degrade, or accesses to files may temporarily hang.
857 If this option is not specified, the
859 command attempts to discover an appropriate callback address automatically.
860 The automatic discovery process is not perfect, however.
861 In the presence of multiple client network interfaces,
862 special routing policies,
863 or atypical network topologies,
864 the exact address to use for callbacks may be nontrivial to determine.
865 .SH nfs4 FILE SYSTEM TYPE
868 file system type is an old syntax for specifying NFSv4 usage. It can still
869 be used with all NFSv4-specific and common options, excepted the
872 .SH MOUNT CONFIGURATION FILE
873 If the mount command is configured to do so, all of the mount options
874 described in the previous section can also be configured in the
875 .I /etc/nfsmount.conf
880 To mount an export using NFS version 2,
883 file system type and specify the
886 To mount using NFS version 3,
889 file system type and specify the
892 To mount using NFS version 4,
895 file system type, with the
901 The following example from an
903 file causes the mount command to negotiate
904 reasonable defaults for NFS behavior.
907 .ta 8n +16n +6n +6n +30n
908 server:/export /mnt nfs defaults 0 0
911 Here is an example from an /etc/fstab file for an NFS version 2 mount over UDP.
914 .ta 8n +16n +6n +6n +30n
915 server:/export /mnt nfs nfsvers=2,proto=udp 0 0
918 Try this example to mount using NFS version 4 over TCP
919 with Kerberos 5 mutual authentication.
922 .ta 8n +16n +6n +6n +30n
923 server:/export /mnt nfs4 sec=krb5 0 0
926 This example can be used to mount /usr over NFS.
929 .ta 8n +16n +6n +6n +30n
930 server:/export /usr nfs ro,nolock,nocto,actimeo=3600 0 0
933 This example shows how to mount an NFS server
934 using a raw IPv6 link-local address.
937 .ta 8n +40n +5n +4n +9n
938 [fe80::215:c5ff:fb3e:e2b1%eth0]:/export /mnt nfs defaults 0 0
940 .SH "TRANSPORT METHODS"
941 NFS clients send requests to NFS servers via
942 Remote Procedure Calls, or
944 The RPC client discovers remote service endpoints automatically,
945 handles per-request authentication,
946 adjusts request parameters for different byte endianness on client and server,
947 and retransmits requests that may have been lost by the network or server.
948 RPC requests and replies flow over a network transport.
952 command, NFS client, and NFS server
953 can automatically negotiate proper transport
954 and data transfer size settings for a mount point.
955 In some cases, however, it pays to specify
956 these settings explicitly using mount options.
958 Traditionally, NFS clients used the UDP transport exclusively for
959 transmitting requests to servers. Though its implementation is
960 simple, NFS over UDP has many limitations that prevent smooth
961 operation and good performance in some common deployment
962 environments. Even an insignificant packet loss rate results in the
963 loss of whole NFS requests; as such, retransmit timeouts are usually
964 in the subsecond range to allow clients to recover quickly from
965 dropped requests, but this can result in extraneous network traffic
968 However, UDP can be quite effective in specialized settings where
969 the networks MTU is large relative to NFSs data transfer size (such
970 as network environments that enable jumbo Ethernet frames). In such
971 environments, trimming the
975 settings so that each
976 NFS read or write request fits in just a few network frames (or even
977 in a single frame) is advised. This reduces the probability that
978 the loss of a single MTU-sized network frame results in the loss of
979 an entire large read or write request.
981 TCP is the default transport protocol used for all modern NFS
982 implementations. It performs well in almost every conceivable
983 network environment and provides excellent guarantees against data
984 corruption caused by network unreliability. TCP is often a
985 requirement for mounting a server through a network firewall.
987 Under normal circumstances, networks drop packets much more
988 frequently than NFS servers drop requests. As such, an aggressive
989 retransmit timeout setting for NFS over TCP is unnecessary. Typical
990 timeout settings for NFS over TCP are between one and ten minutes.
991 After the client exhausts its retransmits (the value of the
993 mount option), it assumes a network partition has occurred,
994 and attempts to reconnect to the server on a fresh socket. Since
995 TCP itself makes network data transfer reliable,
999 can safely be allowed to default to the largest values supported by
1000 both client and server, independent of the network's MTU size.
1001 .SS "Using the mountproto mount option"
1002 This section applies only to NFS version 2 and version 3 mounts
1003 since NFS version 4 does not use a separate protocol for mount
1006 The Linux NFS client can use a different transport for
1007 contacting an NFS server's rpcbind service, its mountd service,
1008 its Network Lock Manager (NLM) service, and its NFS service.
1009 The exact transports employed by the Linux NFS client for
1010 each mount point depends on the settings of the transport
1011 mount options, which include
1014 .BR udp ", and " tcp .
1016 The client sends Network Status Manager (NSM) notifications
1017 via UDP no matter what transport options are specified, but
1018 listens for server NSM notifications on both UDP and TCP.
1019 The NFS Access Control List (NFSACL) protocol shares the same
1020 transport as the main NFS service.
1022 If no transport options are specified, the Linux NFS client
1023 uses UDP to contact the server's mountd service, and TCP to
1024 contact its NLM and NFS services by default.
1026 If the server does not support these transports for these services, the
1028 command attempts to discover what the server supports, and then retries
1029 the mount request once using the discovered transports.
1030 If the server does not advertise any transport supported by the client
1031 or is misconfigured, the mount request fails.
1034 option is in effect, the mount command backgrounds itself and continues
1035 to attempt the specified mount request.
1043 option is specified but the
1045 option is not, the specified transport is used to contact
1046 both the server's mountd service and for the NLM and NFS services.
1050 option is specified but none of the
1051 .BR proto ", " udp " or " tcp
1052 options are specified, then the specified transport is used for the
1053 initial mountd request, but the mount command attempts to discover
1054 what the server supports for the NFS protocol, preferring TCP if
1055 both transports are supported.
1058 .BR mountproto " and " proto
1060 .BR udp " or " tcp )
1061 options are specified, then the transport specified by the
1063 option is used for the initial mountd request, and the transport
1067 .BR udp " or " tcp " options)"
1068 is used for NFS, no matter what order these options appear.
1069 No automatic service discovery is performed if these options are
1073 .BR proto ", " udp ", " tcp ", "
1076 options are specified more than once on the same mount command line,
1077 then the value of the rightmost instance of each of these options
1079 .SH "DATA AND METADATA COHERENCE"
1080 Some modern cluster file systems provide
1081 perfect cache coherence among their clients.
1082 Perfect cache coherence among disparate NFS clients
1083 is expensive to achieve, especially on wide area networks.
1084 As such, NFS settles for weaker cache coherence that
1085 satisfies the requirements of most file sharing types. Normally,
1086 file sharing is completely sequential:
1087 first client A opens a file, writes something to it, then closes it;
1088 then client B opens the same file, and reads the changes.
1090 .SS "Close-to-open cache consistency"
1091 When an application opens a file stored on an NFS server,
1092 the NFS client checks that it still exists on the server
1093 and is permitted to the opener by sending a GETATTR or ACCESS request.
1094 When the application closes the file,
1095 the NFS client writes back any pending changes
1096 to the file so that the next opener can view the changes.
1097 This also gives the NFS client an opportunity to report
1098 any server write errors to the application
1099 via the return code from
1101 The behavior of checking at open time and flushing at close time
1102 is referred to as close-to-open cache consistency.
1103 .SS "Weak cache consistency"
1104 There are still opportunities for a client's data cache
1105 to contain stale data.
1106 The NFS version 3 protocol introduced "weak cache consistency"
1107 (also known as WCC) which provides a way of efficiently checking
1108 a file's attributes before and after a single request.
1109 This allows a client to help identify changes
1110 that could have been made by other clients.
1112 When a client is using many concurrent operations
1113 that update the same file at the same time
1114 (for example, during asynchronous write behind),
1115 it is still difficult to tell whether it was
1116 that client's updates or some other client's updates
1117 that altered the file.
1118 .SS "Attribute caching"
1121 mount option to achieve attribute cache coherence
1122 among multiple clients.
1123 Almost every file system operation checks
1124 file attribute information.
1125 The client keeps this information cached
1126 for a period of time to reduce network and server load.
1129 is in effect, a client's file attribute cache is disabled,
1130 so each operation that needs to check a file's attributes
1131 is forced to go back to the server.
1132 This permits a client to see changes to a file very quickly,
1133 at the cost of many extra network operations.
1135 Be careful not to confuse the
1137 option with "no data caching."
1140 mount option prevents the client from caching file metadata,
1141 but there are still races that may result in data cache incoherence
1142 between client and server.
1144 The NFS protocol is not designed to support
1145 true cluster file system cache coherence
1146 without some type of application serialization.
1147 If absolute cache coherence among clients is required,
1148 applications should use file locking. Alternatively, applications
1149 can also open their files with the O_DIRECT flag
1150 to disable data caching entirely.
1151 .SS "Directory entry caching"
1152 The Linux NFS client caches the result of all NFS LOOKUP requests.
1153 If the requested directory entry exists on the server,
1154 the result is referred to as a
1155 .IR positive " lookup result.
1156 If the requested directory entry does not exist on the server
1157 (that is, the server returned ENOENT),
1158 the result is referred to as
1159 .IR negative " lookup result.
1161 To detect when directory entries have been added or removed
1163 the Linux NFS client watches a directory's mtime.
1164 If the client detects a change in a directory's mtime,
1165 the client drops all cached LOOKUP results for that directory.
1166 Since the directory's mtime is a cached attribute, it may
1167 take some time before a client notices it has changed.
1168 See the descriptions of the
1169 .BR acdirmin ", " acdirmax ", and " noac
1170 mount options for more information about
1171 how long a directory's mtime is cached.
1173 Caching directory entries improves the performance of applications that
1174 do not share files with applications on other clients.
1175 Using cached information about directories can interfere
1176 with applications that run concurrently on multiple clients and
1177 need to detect the creation or removal of files quickly, however.
1180 mount option allows some tuning of directory entry caching behavior.
1182 Before kernel release 2.6.28,
1183 the Linux NFS client tracked only positive lookup results.
1184 This permitted applications to detect new directory entries
1185 created by other clients quickly while still providing some of the
1186 performance benefits of caching.
1187 If an application depends on the previous lookup caching behavior
1188 of the Linux NFS client, you can use
1189 .BR lookupcache=positive .
1191 If the client ignores its cache and validates every application
1192 lookup request with the server,
1193 that client can immediately detect when a new directory
1194 entry has been either created or removed by another client.
1195 You can specify this behavior using
1196 .BR lookupcache=none .
1197 The extra NFS requests needed if the client does not
1198 cache directory entries can exact a performance penalty.
1199 Disabling lookup caching
1200 should result in less of a performance penalty than using
1202 and has no effect on how the NFS client caches the attributes of files.
1204 .SS "The sync mount option"
1205 The NFS client treats the
1207 mount option differently than some other file systems
1210 for a description of the generic
1219 is specified (or if the
1221 option is specified),
1222 the NFS client delays sending application
1223 writes to the server
1224 until any of these events occur:
1226 Memory pressure forces reclamation of system memory resources.
1228 An application flushes file data explicitly with
1234 An application closes a file with
1237 The file is locked/unlocked via
1240 In other words, under normal circumstances,
1241 data written by an application may not immediately appear
1242 on the server that hosts the file.
1246 option is specified on a mount point,
1247 any system call that writes data to files on that mount point
1248 causes that data to be flushed to the server
1249 before the system call returns control to user space.
1250 This provides greater data cache coherence among clients,
1251 but at a significant performance cost.
1253 Applications can use the O_SYNC open flag to force application
1254 writes to individual files to go to the server immediately without
1258 .SS "Using file locks with NFS"
1259 The Network Lock Manager protocol is a separate sideband protocol
1260 used to manage file locks in NFS version 2 and version 3.
1261 To support lock recovery after a client or server reboot,
1262 a second sideband protocol --
1263 known as the Network Status Manager protocol --
1266 file locking is supported directly in the main NFS protocol,
1267 and the NLM and NSM sideband protocols are not used.
1269 In most cases, NLM and NSM services are started automatically,
1270 and no extra configuration is required.
1271 Configure all NFS clients with fully-qualified domain names
1272 to ensure that NFS servers can find clients to notify them of server reboots.
1274 NLM supports advisory file locks only.
1275 To lock NFS files, use
1277 with the F_GETLK and F_SETLK commands.
1278 The NFS client converts file locks obtained via
1282 When mounting servers that do not support the NLM protocol,
1283 or when mounting an NFS server through a firewall
1284 that blocks the NLM service port,
1287 mount option. NLM locking must be disabled with the
1289 option when using NFS to mount
1293 contains files used by the NLM implementation on Linux.
1297 option may also be advised to improve the performance
1298 of a proprietary application which runs on a single client
1299 and uses file locks extensively.
1300 .SS "NFS version 4 caching features"
1301 The data and metadata caching behavior of NFS version 4
1302 clients is similar to that of earlier versions.
1303 However, NFS version 4 adds two features that improve
1305 .I change attributes
1307 .IR "file delegation" .
1311 is a new part of NFS file and directory metadata
1312 which tracks data changes.
1313 It replaces the use of a file's modification
1314 and change time stamps
1315 as a way for clients to validate the content
1317 Change attributes are independent of the time stamp
1318 resolution on either the server or client, however.
1322 is a contract between an NFS version 4 client
1323 and server that allows the client to treat a file temporarily
1324 as if no other client is accessing it.
1325 The server promises to notify the client (via a callback request) if another client
1326 attempts to access that file.
1327 Once a file has been delegated to a client, the client can
1328 cache that file's data and metadata aggressively without
1329 contacting the server.
1331 File delegations come in two flavors:
1337 delegation means that the server notifies the client
1338 about any other clients that want to write to the file.
1341 delegation means that the client gets notified about
1342 either read or write accessors.
1344 Servers grant file delegations when a file is opened,
1345 and can recall delegations at any time when another
1346 client wants access to the file that conflicts with
1347 any delegations already granted.
1348 Delegations on directories are not supported.
1350 In order to support delegation callback, the server
1351 checks the network return path to the client during
1352 the client's initial contact with the server.
1353 If contact with the client cannot be established,
1354 the server simply does not grant any delegations to
1356 .SH "SECURITY CONSIDERATIONS"
1357 NFS servers control access to file data,
1358 but they depend on their RPC implementation
1359 to provide authentication of NFS requests.
1360 Traditional NFS access control mimics
1361 the standard mode bit access control provided in local file systems.
1362 Traditional RPC authentication uses a number
1363 to represent each user
1364 (usually the user's own uid),
1365 a number to represent the user's group (the user's gid),
1366 and a set of up to 16 auxiliary group numbers
1367 to represent other groups of which the user may be a member.
1369 Typically, file data and user ID values appear unencrypted
1370 (i.e. "in the clear") on the network.
1371 Moreover, NFS versions 2 and 3 use
1372 separate sideband protocols for mounting,
1373 locking and unlocking files,
1374 and reporting system status of clients and servers.
1375 These auxiliary protocols use no authentication.
1377 In addition to combining these sideband protocols with the main NFS protocol,
1378 NFS version 4 introduces more advanced forms of access control,
1379 authentication, and in-transit data protection.
1380 The NFS version 4 specification mandates NFSv4 ACLs,
1381 RPCGSS authentication, and RPCGSS security flavors
1382 that provide per-RPC integrity checking and encryption.
1383 Because NFS version 4 combines the
1384 function of the sideband protocols into the main NFS protocol,
1385 the new security features apply to all NFS version 4 operations
1386 including mounting, file locking, and so on.
1387 RPCGSS authentication can also be used with NFS versions 2 and 3,
1388 but does not protect their sideband protocols.
1392 mount option specifies the RPCGSS security mode
1393 that is in effect on a given NFS mount point.
1396 provides cryptographic proof of a user's identity in each RPC request.
1397 This provides strong verification of the identity of users
1398 accessing data on the server.
1399 Note that additional configuration besides adding this mount option
1400 is required in order to enable Kerberos security.
1403 man page for details.
1405 Two additional flavors of Kerberos security are supported:
1411 security flavor provides a cryptographically strong guarantee
1412 that the data in each RPC request has not been tampered with.
1415 security flavor encrypts every RPC request
1416 to prevent data exposure during network transit; however,
1417 expect some performance impact
1418 when using integrity checking or encryption.
1419 Similar support for other forms of cryptographic security (such as lipkey and SPKM3)
1422 The NFS version 4 protocol allows
1423 clients and servers to negotiate among multiple security flavors
1424 during mount processing.
1425 However, Linux does not yet implement such negotiation.
1426 The Linux client specifies a single security flavor at mount time
1427 which remains in effect for the lifetime of the mount.
1428 If the server does not support this flavor,
1429 the initial mount request is rejected by the server.
1430 .SS "Using non-privileged source ports"
1431 NFS clients usually communicate with NFS servers via network sockets.
1432 Each end of a socket is assigned a port value, which is simply a number
1433 between 1 and 65535 that distinguishes socket endpoints at the same
1435 A socket is uniquely defined by a tuple that includes the transport
1436 protocol (TCP or UDP) and the port values and IP addresses of both
1439 The NFS client can choose any source port value for its sockets,
1440 but usually chooses a
1443 A privileged port is a port value less than 1024.
1444 Only a process with root privileges may create a socket
1445 with a privileged source port.
1447 The exact range of privileged source ports that can be chosen is
1448 set by a pair of sysctls to avoid choosing a well-known port, such as
1449 the port used by ssh.
1450 This means the number of source ports available for the NFS client,
1451 and therefore the number of socket connections that can be used
1453 is practically limited to only a few hundred.
1455 As described above, the traditional default NFS authentication scheme,
1456 known as AUTH_SYS, relies on sending local UID and GID numbers to identify
1457 users making NFS requests.
1458 An NFS server assumes that if a connection comes from a privileged port,
1459 the UID and GID numbers in the NFS requests on this connection have been
1460 verified by the client's kernel or some other local authority.
1461 This is an easy system to spoof, but on a trusted physical network between
1462 trusted hosts, it is entirely adequate.
1464 Roughly speaking, one socket is used for each NFS mount point.
1465 If a client could use non-privileged source ports as well,
1466 the number of sockets allowed,
1467 and thus the maximum number of concurrent mount points,
1468 would be much larger.
1470 Using non-privileged source ports may compromise server security somewhat,
1471 since any user on AUTH_SYS mount points can now pretend to be any other
1472 when making NFS requests.
1473 Thus NFS servers do not support this by default.
1474 They explicitly allow it usually via an export option.
1476 To retain good security while allowing as many mount points as possible,
1477 it is best to allow non-privileged client connections only if the server
1478 and client both require strong authentication, such as Kerberos.
1479 .SS "Mounting through a firewall"
1480 A firewall may reside between an NFS client and server,
1481 or the client or server may block some of its own ports via IP
1483 It is still possible to mount an NFS server through a firewall,
1486 command's automatic service endpoint discovery mechanisms may not work; this
1487 requires you to provide specific endpoint details via NFS mount options.
1489 NFS servers normally run a portmapper or rpcbind daemon to advertise
1490 their service endpoints to clients. Clients use the rpcbind daemon to determine:
1492 What network port each RPC-based service is using
1494 What transport protocols each RPC-based service supports
1496 The rpcbind daemon uses a well-known port number (111) to help clients find a service endpoint.
1497 Although NFS often uses a standard port number (2049),
1498 auxiliary services such as the NLM service can choose
1499 any unused port number at random.
1501 Common firewall configurations block the well-known rpcbind port.
1502 In the absense of an rpcbind service,
1503 the server administrator fixes the port number
1504 of NFS-related services so that the firewall
1505 can allow access to specific NFS service ports.
1506 Client administrators then specify the port number
1507 for the mountd service via the
1512 It may also be necessary to enforce the use of TCP or UDP
1513 if the firewall blocks one of those transports.
1514 .SS "NFS Access Control Lists"
1515 Solaris allows NFS version 3 clients direct access
1516 to POSIX Access Control Lists stored in its local file systems.
1517 This proprietary sideband protocol, known as NFSACL,
1518 provides richer access control than mode bits.
1519 Linux implements this protocol
1520 for compatibility with the Solaris NFS implementation.
1521 The NFSACL protocol never became a standard part
1522 of the NFS version 3 specification, however.
1524 The NFS version 4 specification mandates a new version
1525 of Access Control Lists that are semantically richer than POSIX ACLs.
1526 NFS version 4 ACLs are not fully compatible with POSIX ACLs; as such,
1527 some translation between the two is required
1528 in an environment that mixes POSIX ACLs and NFS version 4.
1529 .SH "THE REMOUNT OPTION"
1530 Generic mount options such as
1532 can be modified on NFS mount points using the
1537 for more information on generic mount options.
1539 With few exceptions, NFS-specific options
1540 are not able to be modified during a remount.
1541 The underlying transport or NFS version
1542 cannot be changed by a remount, for example.
1544 Performing a remount on an NFS file system mounted with the
1546 option may have unintended consequences.
1549 option is a combination of the generic option
1551 and the NFS-specific option
1553 .SS "Unmounting after a remount"
1554 For mount points that use NFS versions 2 or 3, the NFS umount subcommand
1555 depends on knowing the original set of mount options used to perform the
1557 These options are stored on disk by the NFS mount subcommand,
1558 and can be erased by a remount.
1560 To ensure that the saved mount options are not erased during a remount,
1561 specify either the local mount directory, or the server hostname and
1562 export pathname, but not both, during a remount. For example,
1566 mount -o remount,ro /mnt
1569 merges the mount option
1571 with the mount options already saved on disk for the NFS server mounted at /mnt.
1577 Before 2.4.7, the Linux NFS client did not support NFS over TCP.
1579 Before 2.4.20, the Linux NFS client used a heuristic
1580 to determine whether cached file data was still valid
1581 rather than using the standard close-to-open cache coherency method
1584 Starting with 2.4.22, the Linux NFS client employs
1585 a Van Jacobsen-based RTT estimator to determine retransmit
1586 timeout values when using NFS over UDP.
1588 Before 2.6.0, the Linux NFS client did not support NFS version 4.
1590 Before 2.6.8, the Linux NFS client used only synchronous reads and writes
1592 .BR rsize " and " wsize
1593 settings were smaller than the system's page size.
1595 The Linux NFS client does not yet support
1596 certain optional features of the NFS version 4 protocol,
1597 such as security negotiation, server referrals, and named attributes.
1612 .BR rpc.svcgssd (8),
1615 RFC 768 for the UDP specification.
1617 RFC 793 for the TCP specification.
1619 RFC 1094 for the NFS version 2 specification.
1621 RFC 1813 for the NFS version 3 specification.
1623 RFC 1832 for the XDR specification.
1625 RFC 1833 for the RPC bind specification.
1627 RFC 2203 for the RPCSEC GSS API protocol specification.
1629 RFC 3530 for the NFS version 4 specification.