]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/mount/nfs.man
nfs(5): Update description of sec= mount option
[nfs-utils.git] / utils / mount / nfs.man
1 .\"@(#)nfs.5"
2 .TH NFS 5 "9 October 2012"
3 .SH NAME
4 nfs \- fstab format and options for the
5 .B nfs
6 file systems
7 .SH SYNOPSIS
8 .I /etc/fstab
9 .SH DESCRIPTION
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
15 of the NFS protocol:
16 NFS version 2 [RFC1094],
17 NFS version 3 [RFC1813],
18 and NFS version 4 [RFC3530].
19 .P
20 The
21 .BR mount (8)
22 command attaches a file system to the system's
23 name space hierarchy at a given mount point.
24 The
25 .I /etc/fstab
26 file describes how
27 .BR mount (8)
28 should assemble a system's file name hierarchy
29 from various independent file systems
30 (including file systems exported by NFS servers).
31 Each line in the
32 .I /etc/fstab
33 file describes a single file system, its mount point,
34 and a set of default mount options for that mount point.
35 .P
36 For NFS file system mounts, a line in the
37 .I /etc/fstab
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:
48 .P
49 .nf
50 .ta 8n +14n +14n +9n +20n
51         server:path     /mountpoint     fstype  option,option,...       0 0
52 .fi
53 .P
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.
58 .P
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
64 interface identifier.
65 See
66 .BR ipv6 (7)
67 for details on specifying raw IPv6 addresses.
68 .P
69 The
70 .I fstype
71 field contains "nfs".  Use of the "nfs4" fstype in
72 .I /etc/fstab
73 is deprecated.
74 .SH "MOUNT OPTIONS"
75 Refer to
76 .BR mount (8)
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
80 .B defaults
81 in
82 .IR /etc/fstab .
83 .DT
84 .SS "Options supported by all versions"
85 These options are valid to use with any NFS version.
86 .TP 1.5i
87 .BR soft " / " hard
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
91 .B hard
92 option is specified), NFS requests are retried indefinitely.
93 If the
94 .B soft
95 option is specified, then the NFS client fails an NFS request
96 after
97 .B retrans
98 retransmissions have been sent,
99 causing the NFS client to return an error
100 to the calling application.
101 .IP
102 .I NB:
103 A so-called "soft" timeout can cause
104 silent data corruption in certain cases. As such, use the
105 .B soft
106 option only when client responsiveness
107 is more important than data integrity.
108 Using NFS over TCP or increasing the value of the
109 .B retrans
110 option may mitigate some of the risks of using the
111 .B soft
112 option.
113 .TP 1.5i
114 .BI timeo= n
115 The time in deciseconds (tenths of a second) the NFS client waits for a
116 response before it retries an NFS request.
117 .IP
118 For NFS over TCP the default
119 .B timeo
120 value is 600 (60 seconds).
121 The NFS client performs linear backoff: After each retransmission the 
122 timeout is increased by
123 .BR timeo 
124 up to the maximum of 600 seconds.
125 .IP
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
129 .B timeo
130 setting for infrequently used request types (such as FSINFO requests).
131 If the
132 .B timeo
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
136 that request,
137 up to a maximum timeout length of 60 seconds.
138 .TP 1.5i
139 .BI retrans= n
140 The number of times the NFS client retries a request before
141 it attempts further recovery action. If the
142 .B retrans
143 option is not specified, the NFS client tries each request
144 three times.
145 .IP
146 The NFS client generates a "server not responding" message
147 after
148 .B retrans
149 retries, then attempts further recovery (depending on whether the
150 .B hard
151 mount option is in effect).
152 .TP 1.5i
153 .BI rsize= n
154 The maximum number of bytes in each network READ request
155 that the NFS client can receive when reading data from a file
156 on an NFS server.
157 The actual data payload size of each NFS READ request is equal to
158 or smaller than the
159 .B rsize
160 setting. The largest read payload supported by the Linux NFS client
161 is 1,048,576 bytes (one megabyte).
162 .IP
163 The
164 .B rsize
165 value is a positive integral multiple of 1024.
166 Specified
167 .B rsize
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
171 multiple of 1024.
172 .IP
173 If an
174 .B rsize
175 value is not specified, or if the specified
176 .B rsize
177 value is larger than the maximum that either client or server can support,
178 the client and server negotiate the largest
179 .B rsize
180 value that they can both support.
181 .IP
182 The
183 .B rsize
184 mount option as specified on the
185 .BR mount (8)
186 command line appears in the
187 .I /etc/mtab
188 file. However, the effective
189 .B rsize
190 value negotiated by the client and server is reported in the
191 .I /proc/mounts
192 file.
193 .TP 1.5i
194 .BI wsize= n
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
199 or smaller than the
200 .B wsize
201 setting. The largest write payload supported by the Linux NFS client
202 is 1,048,576 bytes (one megabyte).
203 .IP
204 Similar to
205 .B rsize
206 , the
207 .B wsize
208 value is a positive integral multiple of 1024.
209 Specified
210 .B wsize
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
214 multiple of 1024.
215 .IP
216 If a
217 .B wsize
218 value is not specified, or if the specified
219 .B wsize
220 value is larger than the maximum that either client or server can support,
221 the client and server negotiate the largest
222 .B wsize
223 value that they can both support.
224 .IP
225 The
226 .B wsize
227 mount option as specified on the
228 .BR mount (8)
229 command line appears in the
230 .I /etc/mtab
231 file. However, the effective
232 .B wsize
233 value negotiated by the client and server is reported in the
234 .I /proc/mounts
235 file.
236 .TP 1.5i
237 .BR ac " / " noac
238 Selects whether the client may cache file attributes. If neither
239 option is specified (or if
240 .B ac
241 is specified), the client caches file
242 attributes.
243 .IP
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
248 server again. The
249 .B noac
250 option prevents clients from caching file
251 attributes so that applications can more quickly detect file changes
252 on the server.
253 .IP
254 In addition to preventing the client from caching file attributes,
255 the
256 .B noac
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.
261 .IP
262 Using the
263 .B noac
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
269 of these trade-offs.
270 .TP 1.5i
271 .BI acregmin= n
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
276 a 3-second minimum.
277 .TP 1.5i
278 .BI acregmax= n
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
283 a 60-second maximum.
284 .TP 1.5i
285 .BI acdirmin= n
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
290 a 30-second minimum.
291 .TP 1.5i
292 .BI acdirmax= n
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
297 a 60-second maximum.
298 .TP 1.5i
299 .BI actimeo= n
300 Using
301 .B actimeo
302 sets all of
303 .BR acregmin ,
304 .BR acregmax ,
305 .BR acdirmin ,
306 and
307 .B acdirmax
308 to the same value.
309 If this option is not specified, the NFS client uses
310 the defaults for each of these options listed above.
311 .TP 1.5i
312 .BR bg " / " fg
313 Determines how the
314 .BR mount (8)
315 command behaves if an attempt to mount an export fails.
316 The
317 .B fg
318 option causes
319 .BR mount (8)
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
324 .B fg
325 nor
326 .B bg
327 mount option is specified.
328 .IP
329 If the
330 .B bg
331 option is specified, a timeout or failure causes the
332 .BR mount (8)
333 command to fork a child which continues to attempt
334 to mount the export.
335 The parent immediately returns with a zero exit code.
336 This is known as a "background" mount.
337 .IP
338 If the local mount point directory is missing, the
339 .BR mount (8)
340 command acts as if the mount request timed out.
341 This permits nested NFS mounts specified in
342 .I /etc/fstab
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
347 .BR automount (8)
348 for details).
349 .TP 1.5i
350 .BR rdirplus " / " nordirplus
351 Selects whether to use NFS v3 or v4 READDIRPLUS requests.
352 If this option is not specified, the NFS client uses READDIRPLUS requests
353 on NFS v3 or v4 mounts to read small directories.
354 Some applications perform better if the client uses only READDIR requests
355 for all directories.
356 .TP 1.5i
357 .BI retry= n
358 The number of minutes that the
359 .BR mount (8)
360 command retries an NFS mount operation
361 in the foreground or background before giving up.
362 If this option is not specified, the default value for foreground mounts
363 is 2 minutes, and the default value for background mounts is 10000 minutes
364 (80 minutes shy of one week).
365 If a value of zero is specified, the
366 .BR mount (8)
367 command exits immediately after the first failure.
368 .TP 1.5i
369 .BI sec= flavor
370 The security flavor to use for accessing files on this mount point.
371 If the server does not support this flavor, the mount operation fails.
372 If
373 .B sec=
374 is not specified, the client attempts to find
375 a security flavor that both the client and the server supports.
376 Valid
377 .I flavors
378 are
379 .BR none ,
380 .BR sys ,
381 .BR krb5 ,
382 .BR krb5i ,
383 and
384 .BR krb5p .
385 Refer to the SECURITY CONSIDERATIONS section for details.
386 .TP 1.5i
387 .BR sharecache " / " nosharecache
388 Determines how the client's data cache and attribute cache are shared
389 when mounting the same export more than once concurrently.  Using the
390 same cache reduces memory requirements on the client and presents
391 identical file contents to applications when the same remote file is
392 accessed via different mount points.
393 .IP
394 If neither option is specified, or if the
395 .B sharecache
396 option is
397 specified, then a single cache is used for all mount points that
398 access the same export.  If the
399 .B nosharecache
400 option is specified,
401 then that mount point gets a unique cache.  Note that when data and
402 attribute caches are shared, the mount options from the first mount
403 point take effect for subsequent concurrent mounts of the same export.
404 .IP
405 As of kernel 2.6.18, the behavior specified by
406 .B nosharecache
407 is legacy caching behavior. This
408 is considered a data risk since multiple cached copies
409 of the same file on the same client can become out of sync
410 following a local update of one of the copies.
411 .TP 1.5i
412 .BR resvport " / " noresvport
413 Specifies whether the NFS client should use a privileged source port
414 when communicating with an NFS server for this mount point.
415 If this option is not specified, or the
416 .B resvport
417 option is specified, the NFS client uses a privileged source port.
418 If the
419 .B noresvport
420 option is specified, the NFS client uses a non-privileged source port.
421 This option is supported in kernels 2.6.28 and later.
422 .IP
423 Using non-privileged source ports helps increase the maximum number of
424 NFS mount points allowed on a client, but NFS servers must be configured
425 to allow clients to connect via non-privileged source ports.
426 .IP
427 Refer to the SECURITY CONSIDERATIONS section for important details.
428 .TP 1.5i
429 .BI lookupcache= mode
430 Specifies how the kernel manages its cache of directory entries
431 for a given mount point.
432 .I mode
433 can be one of
434 .BR all ,
435 .BR none ,
436 .BR pos ,
437 or
438 .BR positive .
439 This option is supported in kernels 2.6.28 and later.
440 .IP
441 The Linux NFS client caches the result of all NFS LOOKUP requests.
442 If the requested directory entry exists on the server,
443 the result is referred to as
444 .IR positive .
445 If the requested directory entry does not exist on the server,
446 the result is referred to as
447 .IR negative .
448 .IP
449 If this option is not specified, or if
450 .B all
451 is specified, the client assumes both types of directory cache entries
452 are valid until their parent directory's cached attributes expire.
453 .IP
454 If
455 .BR pos " or " positive
456 is specified, the client assumes positive entries are valid
457 until their parent directory's cached attributes expire, but
458 always revalidates negative entires before an application
459 can use them.
460 .IP
461 If
462 .B none
463 is specified,
464 the client revalidates both types of directory cache entries
465 before an application can use them.
466 This permits quick detection of files that were created or removed
467 by other clients, but can impact application and server performance.
468 .IP
469 The DATA AND METADATA COHERENCE section contains a
470 detailed discussion of these trade-offs.
471 .TP 1.5i
472 .BR fsc " / " nofsc
473 Enable/Disables the cache of (read-only) data pages to the local disk 
474 using the FS-Cache facility. See cachefilesd(8) 
475 and <kernel_soruce>/Documentation/filesystems/caching
476 for detail on how to configure the FS-Cache facility.
477 Default value is nofsc.
478 .SS "Options for NFS versions 2 and 3 only"
479 Use these options, along with the options in the above subsection,
480 for NFS versions 2 and 3 only.
481 .TP 1.5i
482 .BI proto= netid
483 The
484 .I netid
485 determines the transport that is used to communicate with the NFS
486 server.  Available options are
487 .BR udp ", " udp6 ", "tcp ", " tcp6 ", and " rdma .
488 Those which end in
489 .B 6
490 use IPv6 addresses and are only available if support for TI-RPC is
491 built in. Others use IPv4 addresses.
492 .IP
493 Each transport protocol uses different default
494 .B retrans
495 and
496 .B timeo
497 settings.
498 Refer to the description of these two mount options for details.
499 .IP
500 In addition to controlling how the NFS client transmits requests to
501 the server, this mount option also controls how the
502 .BR mount (8)
503 command communicates with the server's rpcbind and mountd services.
504 Specifying a netid that uses TCP forces all traffic from the
505 .BR mount (8)
506 command and the NFS client to use TCP.
507 Specifying a netid that uses UDP forces all traffic types to use UDP.
508 .IP
509 .B Before using NFS over UDP, refer to the TRANSPORT METHODS section.
510 .IP
511 If the
512 .B proto
513 mount option is not specified, the
514 .BR mount (8)
515 command discovers which protocols the server supports
516 and chooses an appropriate transport for each service.
517 Refer to the TRANSPORT METHODS section for more details.
518 .TP 1.5i
519 .B udp
520 The
521 .B udp
522 option is an alternative to specifying
523 .BR proto=udp.
524 It is included for compatibility with other operating systems.
525 .IP
526 .B Before using NFS over UDP, refer to the TRANSPORT METHODS section.
527 .TP 1.5i
528 .B tcp
529 The
530 .B tcp
531 option is an alternative to specifying
532 .BR proto=tcp.
533 It is included for compatibility with other operating systems.
534 .TP 1.5i
535 .B rdma
536 The
537 .B rdma
538 option is an alternative to specifying
539 .BR proto=rdma.
540 .TP 1.5i
541 .BI port= n
542 The numeric value of the server's NFS service port.
543 If the server's NFS service is not available on the specified port,
544 the mount request fails.
545 .IP
546 If this option is not specified, or if the specified port value is 0,
547 then the NFS client uses the NFS service port number
548 advertised by the server's rpcbind service.
549 The mount request fails if the server's rpcbind service is not available,
550 the server's NFS service is not registered with its rpcbind service,
551 or the server's NFS service is not available on the advertised port.
552 .TP 1.5i
553 .BI mountport= n
554 The numeric value of the server's mountd port.
555 If the server's mountd service is not available on the specified port,
556 the mount request fails.
557 .IP
558 If this option is not specified,
559 or if the specified port value is 0, then the
560 .BR mount (8)
561 command uses the mountd service port number
562 advertised by the server's rpcbind service.
563 The mount request fails if the server's rpcbind service is not available,
564 the server's mountd service is not registered with its rpcbind service,
565 or the server's mountd service is not available on the advertised port.
566 .IP
567 This option can be used when mounting an NFS server
568 through a firewall that blocks the rpcbind protocol.
569 .TP 1.5i
570 .BI mountproto= netid
571 The transport the NFS client uses
572 to transmit requests to the NFS server's mountd service when performing
573 this mount request, and when later unmounting this mount point.
574 .IP
575 .I netid
576 may be one of
577 .BR udp ", and " tcp
578 which use IPv4 address or, if TI-RPC is built into the
579 .B mount.nfs
580 command,
581 .BR udp6 ", and " tcp6
582 which use IPv6 addresses.
583 .IP
584 This option can be used when mounting an NFS server
585 through a firewall that blocks a particular transport.
586 When used in combination with the
587 .B proto
588 option, different transports for mountd requests and NFS requests
589 can be specified.
590 If the server's mountd service is not available via the specified
591 transport, the mount request fails.
592 .IP
593 Refer to the TRANSPORT METHODS section for more on how the
594 .B mountproto
595 mount option interacts with the
596 .B proto
597 mount option.
598 .TP 1.5i
599 .BI mounthost= name
600 The hostname of the host running mountd.
601 If this option is not specified, the
602 .BR mount (8)
603 command assumes that the mountd service runs
604 on the same host as the NFS service.
605 .TP 1.5i
606 .BI mountvers= n
607 The RPC version number used to contact the server's mountd.
608 If this option is not specified, the client uses a version number
609 appropriate to the requested NFS version.
610 This option is useful when multiple NFS services
611 are running on the same remote server host.
612 .TP 1.5i
613 .BI namlen= n
614 The maximum length of a pathname component on this mount.
615 If this option is not specified, the maximum length is negotiated
616 with the server. In most cases, this maximum length is 255 characters.
617 .IP
618 Some early versions of NFS did not support this negotiation.
619 Using this option ensures that
620 .BR pathconf (3)
621 reports the proper maximum component length to applications
622 in such cases.
623 .TP 1.5i
624 .BI nfsvers= n
625 The NFS protocol version number used to contact the server's NFS service.
626 If the server does not support the requested version, the mount request fails.
627 If this option is not specified, the client negotiates a suitable version with
628 the server, trying version 4 first, version 3 second, and version 2 last.
629 .TP 1.5i
630 .BI vers= n
631 This option is an alternative to the
632 .B nfsvers
633 option.
634 It is included for compatibility with other operating systems.
635 .TP 1.5i
636 .BR lock " / " nolock
637 Selects whether to use the NLM sideband protocol to lock files on the server.
638 If neither option is specified (or if
639 .B lock
640 is specified), NLM locking is used for this mount point.
641 When using the
642 .B nolock
643 option, applications can lock files,
644 but such locks provide exclusion only against other applications
645 running on the same client.
646 Remote applications are not affected by these locks.
647 .IP
648 NLM locking must be disabled with the
649 .B nolock
650 option when using NFS to mount
651 .I /var
652 because
653 .I /var
654 contains files used by the NLM implementation on Linux.
655 Using the
656 .B nolock
657 option is also required when mounting exports on NFS servers
658 that do not support the NLM protocol.
659 .TP 1.5i
660 .BR intr " / " nointr
661 Selects whether to allow signals to interrupt file operations
662 on this mount point. If neither option
663 is specified (or if
664 .B nointr
665 is specified),
666 signals do not interrupt NFS file operations. If
667 .B intr
668 is specified, system calls return EINTR if an in-progress NFS operation is interrupted by
669 a signal.
670 .IP
671 Using the
672 .B intr
673 option is preferred to using the
674 .B soft
675 option because it is significantly less likely to result in data corruption.
676 .IP
677 The
678 .BR intr " / " nointr
679 mount option is deprecated after kernel 2.6.25.
680 Only SIGKILL can interrupt a pending NFS operation on these kernels,
681 and if specified, this mount option is ignored to provide backwards
682 compatibility with older kernels.
683 .TP 1.5i
684 .BR cto " / " nocto
685 Selects whether to use close-to-open cache coherence semantics.
686 If neither option is specified (or if
687 .B cto
688 is specified), the client uses close-to-open
689 cache coherence semantics. If the
690 .B nocto
691 option is specified, the client uses a non-standard heuristic to determine when
692 files on the server have changed.
693 .IP
694 Using the
695 .B nocto
696 option may improve performance for read-only mounts,
697 but should be used only if the data on the server changes only occasionally.
698 The DATA AND METADATA COHERENCE section discusses the behavior
699 of this option in more detail.
700 .TP 1.5i
701 .BR acl " / " noacl
702 Selects whether to use the NFSACL sideband protocol on this mount point.
703 The NFSACL sideband protocol is a proprietary protocol
704 implemented in Solaris that manages Access Control Lists. NFSACL was never
705 made a standard part of the NFS protocol specification.
706 .IP
707 If neither
708 .B acl
709 nor
710 .B noacl
711 option is specified,
712 the NFS client negotiates with the server
713 to see if the NFSACL protocol is supported,
714 and uses it if the server supports it.
715 Disabling the NFSACL sideband protocol may be necessary
716 if the negotiation causes problems on the client or server.
717 Refer to the SECURITY CONSIDERATIONS section for more details.
718 .TP 1.5i
719 .BR local_lock= mechanism
720 Specifies whether to use local locking for any or both of the flock and the
721 POSIX locking mechanisms.
722 .I mechanism
723 can be one of
724 .BR all ,
725 .BR flock ,
726 .BR posix ,
727 or
728 .BR none .
729 This option is supported in kernels 2.6.37 and later.
730 .IP
731 The Linux NFS client provides a way to make locks local. This means, the
732 applications can lock files, but such locks provide exclusion only against
733 other applications running on the same client. Remote applications are not
734 affected by these locks.
735 .IP
736 If this option is not specified, or if
737 .B none
738 is specified, the client assumes that the locks are not local.
739 .IP
740 If
741 .BR all
742 is specified, the client assumes that both flock and POSIX locks are local.
743 .IP
744 If
745 .BR flock
746 is specified, the client assumes that only flock locks are local and uses
747 NLM sideband protocol to lock files when POSIX locks are used.
748 .IP
749 If
750 .BR posix
751 is specified, the client assumes that POSIX locks are local and uses NLM
752 sideband protocol to lock files when flock locks are used.
753 .IP
754 To support legacy flock behavior similar to that of NFS clients < 2.6.12, 
755 use 'local_lock=flock'. This option is required when exporting NFS mounts via
756 Samba as Samba maps Windows share mode locks as flock. Since NFS clients >
757 2.6.12 implement flock by emulating POSIX locks, this will result in
758 conflicting locks.
759 .IP
760 NOTE: When used together, the 'local_lock' mount option will be overridden
761 by 'nolock'/'lock' mount option.
762 .SS "Options for NFS version 4 only"
763 Use these options, along with the options in the first subsection above,
764 for NFS version 4 and newer.
765 .TP 1.5i
766 .BI proto= netid
767 The
768 .I netid
769 determines the transport that is used to communicate with the NFS
770 server.  Supported options are
771 .BR tcp ", " tcp6 ", and " rdma .
772 .B tcp6
773 use IPv6 addresses and is only available if support for TI-RPC is
774 built in. Both others use IPv4 addresses.
775 .IP
776 All NFS version 4 servers are required to support TCP,
777 so if this mount option is not specified, the NFS version 4 client
778 uses the TCP protocol.
779 Refer to the TRANSPORT METHODS section for more details.
780 .TP 1.5i
781 .BI port= n
782 The numeric value of the server's NFS service port.
783 If the server's NFS service is not available on the specified port,
784 the mount request fails.
785 .IP
786 If this mount option is not specified,
787 the NFS client uses the standard NFS port number of 2049
788 without first checking the server's rpcbind service.
789 This allows an NFS version 4 client to contact an NFS version 4
790 server through a firewall that may block rpcbind requests.
791 .IP
792 If the specified port value is 0,
793 then the NFS client uses the NFS service port number
794 advertised by the server's rpcbind service.
795 The mount request fails if the server's rpcbind service is not available,
796 the server's NFS service is not registered with its rpcbind service,
797 or the server's NFS service is not available on the advertised port.
798 .TP 1.5i
799 .BR intr " / " nointr
800 Selects whether to allow signals to interrupt file operations
801 on this mount point. If neither option is specified (or if
802 .B intr
803 is specified), system calls return EINTR if an in-progress NFS operation
804 is interrupted by a signal.  If
805 .B nointr
806 is specified, signals do not
807 interrupt NFS operations.
808 .IP
809 Using the
810 .B intr
811 option is preferred to using the
812 .B soft
813 option because it is significantly less likely to result in data corruption.
814 .IP
815 The
816 .BR intr " / " nointr
817 mount option is deprecated after kernel 2.6.25.
818 Only SIGKILL can interrupt a pending NFS operation on these kernels,
819 and if specified, this mount option is ignored to provide backwards
820 compatibility with older kernels.
821 .TP 1.5i
822 .BR cto " / " nocto
823 Selects whether to use close-to-open cache coherence semantics
824 for NFS directories on this mount point.
825 If neither
826 .B cto
827 nor
828 .B nocto
829 is specified,
830 the default is to use close-to-open cache coherence
831 semantics for directories.
832 .IP
833 File data caching behavior is not affected by this option.
834 The DATA AND METADATA COHERENCE section discusses
835 the behavior of this option in more detail.
836 .TP 1.5i
837 .BI clientaddr= n.n.n.n
838 .TP 1.5i
839 .BI clientaddr= n:n: ... :n
840 Specifies a single IPv4 address (in dotted-quad form),
841 or a non-link-local IPv6 address,
842 that the NFS client advertises to allow servers
843 to perform NFS version 4 callback requests against
844 files on this mount point. If  the  server is unable to
845 establish callback connections to clients, performance
846 may degrade, or accesses to files may temporarily hang.
847 .IP
848 If this option is not specified, the
849 .BR mount (8)
850 command attempts to discover an appropriate callback address automatically.
851 The automatic discovery process is not perfect, however.
852 In the presence of multiple client network interfaces,
853 special routing policies,
854 or atypical network topologies,
855 the exact address to use for callbacks may be nontrivial to determine.
856 .SH nfs4 FILE SYSTEM TYPE
857 The
858 .BR nfs4
859 file system type is an old syntax for specifying NFSv4 usage. It can still 
860 be used with all NFSv4-specific and common options, excepted the
861 .B nfsvers
862 mount option.
863 .SH MOUNT CONFIGURATION FILE
864 If the mount command is configured to do so, all of the mount options 
865 described in the previous section can also be configured in the 
866 .I /etc/nfsmount.conf 
867 file. See 
868 .BR nfsmount.conf(5)
869 for details.
870 .SH EXAMPLES
871 To mount an export using NFS version 2,
872 use the
873 .B nfs
874 file system type and specify the
875 .B nfsvers=2
876 mount option.
877 To mount using NFS version 3,
878 use the
879 .B nfs
880 file system type and specify the
881 .B nfsvers=3
882 mount option.
883 To mount using NFS version 4,
884 use either the
885 .B nfs
886 file system type, with the
887 .B nfsvers=4
888 mount option, or the 
889 .B nfs4
890 file system type.
891 .P
892 The following example from an
893 .I /etc/fstab
894 file causes the mount command to negotiate
895 reasonable defaults for NFS behavior.
896 .P
897 .nf
898 .ta 8n +16n +6n +6n +30n
899         server:/export  /mnt    nfs     defaults        0 0
900 .fi
901 .P
902 Here is an example from an /etc/fstab file for an NFS version 2 mount over UDP.
903 .P
904 .nf
905 .ta 8n +16n +6n +6n +30n
906         server:/export  /mnt    nfs     nfsvers=2,proto=udp     0 0
907 .fi
908 .P
909 Try this example to mount using NFS version 4 over TCP
910 with Kerberos 5 mutual authentication.
911 .P
912 .nf
913 .ta 8n +16n +6n +6n +30n
914         server:/export  /mnt    nfs4    sec=krb5        0 0
915 .fi
916 .P
917 This example can be used to mount /usr over NFS.
918 .P
919 .nf
920 .ta 8n +16n +6n +6n +30n
921         server:/export  /usr    nfs     ro,nolock,nocto,actimeo=3600    0 0
922 .fi
923 .P
924 This example shows how to mount an NFS server
925 using a raw IPv6 link-local address.
926 .P
927 .nf
928 .ta 8n +40n +5n +4n +9n
929         [fe80::215:c5ff:fb3e:e2b1%eth0]:/export /mnt    nfs     defaults        0 0
930 .fi
931 .SH "TRANSPORT METHODS"
932 NFS clients send requests to NFS servers via
933 Remote Procedure Calls, or
934 .IR RPCs .
935 The RPC client discovers remote service endpoints automatically,
936 handles per-request authentication,
937 adjusts request parameters for different byte endianness on client and server,
938 and retransmits requests that may have been lost by the network or server.
939 RPC requests and replies flow over a network transport.
940 .P
941 In most cases, the
942 .BR mount (8)
943 command, NFS client, and NFS server
944 can automatically negotiate proper transport
945 and data transfer size settings for a mount point.
946 In some cases, however, it pays to specify
947 these settings explicitly using mount options.
948 .P
949 Traditionally, NFS clients used the UDP transport exclusively for
950 transmitting requests to servers.  Though its implementation is
951 simple, NFS over UDP has many limitations that prevent smooth
952 operation and good performance in some common deployment
953 environments.  Even an insignificant packet loss rate results in the
954 loss of whole NFS requests; as such, retransmit timeouts are usually
955 in the subsecond range to allow clients to recover quickly from
956 dropped requests, but this can result in extraneous network traffic
957 and server load.
958 .P
959 However, UDP can be quite effective in specialized settings where
960 the networks MTU is large relative to NFSs data transfer size (such
961 as network environments that enable jumbo Ethernet frames).  In such
962 environments, trimming the
963 .B rsize
964 and
965 .B wsize
966 settings so that each
967 NFS read or write request fits in just a few network frames (or even
968 in  a single  frame) is advised.  This reduces the probability that
969 the loss of a single MTU-sized network frame results in the loss of
970 an entire large read or write request.
971 .P
972 TCP is the default transport protocol used for all modern NFS
973 implementations.  It performs well in almost every conceivable
974 network environment and provides excellent guarantees against data
975 corruption caused by network unreliability.  TCP is often a
976 requirement for mounting a server through a network firewall.
977 .P
978 Under normal circumstances, networks drop packets much more
979 frequently than NFS servers drop requests.  As such, an aggressive
980 retransmit timeout  setting for NFS over TCP is unnecessary. Typical
981 timeout settings for NFS over TCP are between one and ten minutes.
982 After  the client exhausts its retransmits (the value of the
983 .B retrans
984 mount option), it assumes a network partition has occurred,
985 and attempts to reconnect to the server on a fresh socket. Since
986 TCP itself makes network data transfer reliable,
987 .B rsize
988 and
989 .B wsize
990 can safely be allowed to default to the largest values supported by
991 both client and server, independent of the network's MTU size.
992 .SS "Using the mountproto mount option"
993 This section applies only to NFS version 2 and version 3 mounts
994 since NFS version 4 does not use a separate protocol for mount
995 requests.
996 .P
997 The Linux NFS client can use a different transport for
998 contacting an NFS server's rpcbind service, its mountd service,
999 its Network Lock Manager (NLM) service, and its NFS service.
1000 The exact transports employed by the Linux NFS client for
1001 each mount point depends on the settings of the transport
1002 mount options, which include
1003 .BR proto ,
1004 .BR mountproto ,
1005 .BR udp ", and " tcp .
1006 .P
1007 The client sends Network Status Manager (NSM) notifications
1008 via UDP no matter what transport options are specified, but
1009 listens for server NSM notifications on both UDP and TCP.
1010 The NFS Access Control List (NFSACL) protocol shares the same
1011 transport as the main NFS service.
1012 .P
1013 If no transport options are specified, the Linux NFS client
1014 uses UDP to contact the server's mountd service, and TCP to
1015 contact its NLM and NFS services by default.
1016 .P
1017 If the server does not support these transports for these services, the
1018 .BR mount (8)
1019 command attempts to discover what the server supports, and then retries
1020 the mount request once using the discovered transports.
1021 If the server does not advertise any transport supported by the client
1022 or is misconfigured, the mount request fails.
1023 If the
1024 .B bg
1025 option is in effect, the mount command backgrounds itself and continues
1026 to attempt the specified mount request.
1027 .P
1028 When the
1029 .B proto
1030 option, the
1031 .B udp
1032 option, or the
1033 .B tcp
1034 option is specified but the
1035 .B mountproto
1036 option is not, the specified transport is used to contact
1037 both the server's mountd service and for the NLM and NFS services.
1038 .P
1039 If the
1040 .B mountproto
1041 option is specified but none of the
1042 .BR proto ", " udp " or " tcp
1043 options are specified, then the specified transport is used for the
1044 initial mountd request, but the mount command attempts to discover
1045 what the server supports for the NFS protocol, preferring TCP if
1046 both transports are supported.
1047 .P
1048 If both the
1049 .BR mountproto " and " proto
1050 (or
1051 .BR udp " or " tcp )
1052 options are specified, then the transport specified by the
1053 .B mountproto
1054 option is used for the initial mountd request, and the transport
1055 specified by the
1056 .B proto
1057 option (or the
1058 .BR udp " or " tcp " options)"
1059 is used for NFS, no matter what order these options appear.
1060 No automatic service discovery is performed if these options are
1061 specified.
1062 .P
1063 If any of the
1064 .BR proto ", " udp ", " tcp ", "
1065 or
1066 .B mountproto
1067 options are specified more than once on the same mount command line,
1068 then the value of the rightmost instance of each of these options
1069 takes effect.
1070 .SS "Using NFS over UDP on high-speed links"
1071 Using NFS over UDP on high-speed links such as Gigabit
1072 .BR "can cause silent data corruption" .
1073 .P
1074 The problem can be triggered at high loads, and is caused by problems in
1075 IP fragment reassembly. NFS read and writes typically transmit UDP packets
1076 of 4 Kilobytes or more, which have to be broken up into several fragments
1077 in order to be sent over the Ethernet link, which limits packets to 1500
1078 bytes by default. This process happens at the IP network layer and is
1079 called fragmentation.
1080 .P
1081 In order to identify fragments that belong together, IP assigns a 16bit
1082 .I IP ID
1083 value to each packet; fragments generated from the same UDP packet
1084 will have the same IP ID. The receiving system will collect these
1085 fragments and combine them to form the original UDP packet. This process
1086 is called reassembly. The default timeout for packet reassembly is
1087 30 seconds; if the network stack does not receive all fragments of
1088 a given packet within this interval, it assumes the missing fragment(s)
1089 got lost and discards those it already received.
1090 .P
1091 The problem this creates over high-speed links is that it is possible
1092 to send more than 65536 packets within 30 seconds. In fact, with
1093 heavy NFS traffic one can observe that the IP IDs repeat after about
1094 5 seconds.
1095 .P
1096 This has serious effects on reassembly: if one fragment gets lost,
1097 another fragment
1098 .I from a different packet
1099 but with the
1100 .I same IP ID
1101 will arrive within the 30 second timeout, and the network stack will
1102 combine these fragments to form a new packet. Most of the time, network
1103 layers above IP will detect this mismatched reassembly - in the case
1104 of UDP, the UDP checksum, which is a 16 bit checksum over the entire
1105 packet payload, will usually not match, and UDP will discard the
1106 bad packet.
1107 .P
1108 However, the UDP checksum is 16 bit only, so there is a chance of 1 in
1109 65536 that it will match even if the packet payload is completely
1110 random (which very often isn't the case). If that is the case,
1111 silent data corruption will occur.
1112 .P
1113 This potential should be taken seriously, at least on Gigabit
1114 Ethernet.
1115 Network speeds of 100Mbit/s should be considered less
1116 problematic, because with most traffic patterns IP ID wrap around
1117 will take much longer than 30 seconds.
1118 .P
1119 It is therefore strongly recommended to use
1120 .BR "NFS over TCP where possible" ,
1121 since TCP does not perform fragmentation.
1122 .P
1123 If you absolutely have to use NFS over UDP over Gigabit Ethernet,
1124 some steps can be taken to mitigate the problem and reduce the
1125 probability of corruption:
1126 .TP +1.5i
1127 .I Jumbo frames:
1128 Many Gigabit network cards are capable of transmitting
1129 frames bigger than the 1500 byte limit of traditional Ethernet, typically
1130 9000 bytes. Using jumbo frames of 9000 bytes will allow you to run NFS over
1131 UDP at a page size of 8K without fragmentation. Of course, this is
1132 only feasible if all involved stations support jumbo frames.
1133 .IP
1134 To enable a machine to send jumbo frames on cards that support it,
1135 it is sufficient to configure the interface for a MTU value of 9000.
1136 .TP +1.5i
1137 .I Lower reassembly timeout:
1138 By lowering this timeout below the time it takes the IP ID counter
1139 to wrap around, incorrect reassembly of fragments can be prevented
1140 as well. To do so, simply write the new timeout value (in seconds)
1141 to the file
1142 .BR /proc/sys/net/ipv4/ipfrag_time .
1143 .IP
1144 A value of 2 seconds will greatly reduce the probability of IPID clashes on
1145 a single Gigabit link, while still allowing for a reasonable timeout
1146 when receiving fragmented traffic from distant peers.
1147 .SH "DATA AND METADATA COHERENCE"
1148 Some modern cluster file systems provide
1149 perfect cache coherence among their clients.
1150 Perfect cache coherence among disparate NFS clients
1151 is expensive to achieve, especially on wide area networks.
1152 As such, NFS settles for weaker cache coherence that
1153 satisfies the requirements of most file sharing types. Normally,
1154 file sharing is completely sequential:
1155 first client A opens a file, writes something to it, then closes it;
1156 then client B opens the same file, and reads the changes.
1157 .DT
1158 .SS "Close-to-open cache consistency"
1159 When an application opens a file stored on an NFS server,
1160 the NFS client checks that it still exists on the server
1161 and is permitted to the opener by sending a GETATTR or ACCESS request.
1162 When the application closes the file,
1163 the NFS client writes back any pending changes
1164 to the file so that the next opener can view the changes.
1165 This also gives the NFS client an opportunity to report
1166 any server write errors to the application
1167 via the return code from
1168 .BR close (2).
1169 The behavior of checking at open time and flushing at close time
1170 is referred to as close-to-open cache consistency.
1171 .SS "Weak cache consistency"
1172 There are still opportunities for a client's data cache
1173 to contain stale data.
1174 The NFS version 3 protocol introduced "weak cache consistency"
1175 (also known as WCC) which provides a way of efficiently checking
1176 a file's attributes before and after a single request.
1177 This allows a client to help identify changes
1178 that could have been made by other clients.
1179 .P
1180 When a client is using many concurrent operations
1181 that update the same file at the same time
1182 (for example, during asynchronous write behind),
1183 it is still difficult to tell whether it was
1184 that client's updates or some other client's updates
1185 that altered the file.
1186 .SS "Attribute caching"
1187 Use the
1188 .B noac
1189 mount option to achieve attribute cache coherence
1190 among multiple clients.
1191 Almost every file system operation checks
1192 file attribute information.
1193 The client keeps this information cached
1194 for a period of time to reduce network and server load.
1195 When
1196 .B noac
1197 is in effect, a client's file attribute cache is disabled,
1198 so each operation that needs to check a file's attributes
1199 is forced to go back to the server.
1200 This permits a client to see changes to a file very quickly,
1201 at the cost of many extra network operations.
1202 .P
1203 Be careful not to confuse the
1204 .B noac
1205 option with "no data caching."
1206 The
1207 .B noac
1208 mount option prevents the client from caching file metadata,
1209 but there are still races that may result in data cache incoherence
1210 between client and server.
1211 .P
1212 The NFS protocol is not designed to support
1213 true cluster file system cache coherence
1214 without some type of application serialization.
1215 If absolute cache coherence among clients is required,
1216 applications should use file locking. Alternatively, applications
1217 can also open their files with the O_DIRECT flag
1218 to disable data caching entirely.
1219 .SS "Directory entry caching"
1220 The Linux NFS client caches the result of all NFS LOOKUP requests.
1221 If the requested directory entry exists on the server,
1222 the result is referred to as a
1223 .IR positive " lookup result.
1224 If the requested directory entry does not exist on the server
1225 (that is, the server returned ENOENT),
1226 the result is referred to as
1227 .IR negative " lookup result.
1228 .P
1229 To detect when directory entries have been added or removed
1230 on the server,
1231 the Linux NFS client watches a directory's mtime.
1232 If the client detects a change in a directory's mtime,
1233 the client drops all cached LOOKUP results for that directory.
1234 Since the directory's mtime is a cached attribute, it may
1235 take some time before a client notices it has changed.
1236 See the descriptions of the
1237 .BR acdirmin ", " acdirmax ", and " noac
1238 mount options for more information about
1239 how long a directory's mtime is cached.
1240 .P
1241 Caching directory entries improves the performance of applications that
1242 do not share files with applications on other clients.
1243 Using cached information about directories can interfere
1244 with applications that run concurrently on multiple clients and
1245 need to detect the creation or removal of files quickly, however.
1246 The
1247 .B lookupcache
1248 mount option allows some tuning of directory entry caching behavior.
1249 .P
1250 Before kernel release 2.6.28,
1251 the Linux NFS client tracked only positive lookup results.
1252 This permitted applications to detect new directory entries
1253 created by other clients quickly while still providing some of the
1254 performance benefits of caching.
1255 If an application depends on the previous lookup caching behavior
1256 of the Linux NFS client, you can use
1257 .BR lookupcache=positive .
1258 .P
1259 If the client ignores its cache and validates every application
1260 lookup request with the server,
1261 that client can immediately detect when a new directory
1262 entry has been either created or removed by another client.
1263 You can specify this behavior using
1264 .BR lookupcache=none .
1265 The extra NFS requests needed if the client does not
1266 cache directory entries can exact a performance penalty.
1267 Disabling lookup caching
1268 should result in less of a performance penalty than using
1269 .BR noac ,
1270 and has no effect on how the NFS client caches the attributes of files.
1271 .P
1272 .SS "The sync mount option"
1273 The NFS client treats the
1274 .B sync
1275 mount option differently than some other file systems
1276 (refer to
1277 .BR mount (8)
1278 for a description of the generic
1279 .B sync
1280 and
1281 .B async
1282 mount options).
1283 If neither
1284 .B sync
1285 nor
1286 .B async
1287 is specified (or if the
1288 .B async
1289 option is specified),
1290 the NFS client delays sending application
1291 writes to the server
1292 until any of these events occur:
1293 .IP
1294 Memory pressure forces reclamation of system memory resources.
1295 .IP
1296 An application flushes file data explicitly with
1297 .BR sync (2),
1298 .BR msync (2),
1299 or
1300 .BR fsync (3).
1301 .IP
1302 An application closes a file with
1303 .BR close (2).
1304 .IP
1305 The file is locked/unlocked via
1306 .BR fcntl (2).
1307 .P
1308 In other words, under normal circumstances,
1309 data written by an application may not immediately appear
1310 on the server that hosts the file.
1311 .P
1312 If the
1313 .B sync
1314 option is specified on a mount point,
1315 any system call that writes data to files on that mount point
1316 causes that data to be flushed to the server
1317 before the system call returns control to user space.
1318 This provides greater data cache coherence among clients,
1319 but at a significant performance cost.
1320 .P
1321 Applications can use the O_SYNC open flag to force application
1322 writes to individual files to go to the server immediately without
1323 the use of the
1324 .B sync
1325 mount option.
1326 .SS "Using file locks with NFS"
1327 The Network Lock Manager protocol is a separate sideband protocol
1328 used to manage file locks in NFS version 2 and version 3.
1329 To support lock recovery after a client or server reboot,
1330 a second sideband protocol --
1331 known as the Network Status Manager protocol --
1332 is also required.
1333 In NFS version 4,
1334 file locking is supported directly in the main NFS protocol,
1335 and the NLM and NSM sideband protocols are not used.
1336 .P
1337 In most cases, NLM and NSM services are started automatically,
1338 and no extra configuration is required.
1339 Configure all NFS clients with fully-qualified domain names
1340 to ensure that NFS servers can find clients to notify them of server reboots.
1341 .P
1342 NLM supports advisory file locks only.
1343 To lock NFS files, use
1344 .BR fcntl (2)
1345 with the F_GETLK and F_SETLK commands.
1346 The NFS client converts file locks obtained via
1347 .BR flock (2)
1348 to advisory locks.
1349 .P
1350 When mounting servers that do not support the NLM protocol,
1351 or when mounting an NFS server through a firewall
1352 that blocks the NLM service port,
1353 specify the
1354 .B nolock
1355 mount option. NLM locking must be disabled with the
1356 .B nolock
1357 option when using NFS to mount
1358 .I /var
1359 because
1360 .I /var
1361 contains files used by the NLM implementation on Linux.
1362 .P
1363 Specifying the
1364 .B nolock
1365 option may also be advised to improve the performance
1366 of a proprietary application which runs on a single client
1367 and uses file locks extensively.
1368 .SS "NFS version 4 caching features"
1369 The data and metadata caching behavior of NFS version 4
1370 clients is similar to that of earlier versions.
1371 However, NFS version 4 adds two features that improve
1372 cache behavior:
1373 .I change attributes
1374 and
1375 .IR "file delegation" .
1376 .P
1377 The
1378 .I change attribute
1379 is a new part of NFS file and directory metadata
1380 which tracks data changes.
1381 It replaces the use of a file's modification
1382 and change time stamps
1383 as a way for clients to validate the content
1384 of their caches.
1385 Change attributes are independent of the time stamp
1386 resolution on either the server or client, however.
1387 .P
1388 A
1389 .I file delegation
1390 is a contract between an NFS version 4 client
1391 and server that allows the client to treat a file temporarily
1392 as if no other client is accessing it.
1393 The server promises to notify the client (via a callback request) if another client
1394 attempts to access that file.
1395 Once a file has been delegated to a client, the client can
1396 cache that file's data and metadata aggressively without
1397 contacting the server.
1398 .P
1399 File delegations come in two flavors:
1400 .I read
1401 and
1402 .IR write .
1403 A
1404 .I read
1405 delegation means that the server notifies the client
1406 about any other clients that want to write to the file.
1407 A
1408 .I write
1409 delegation means that the client gets notified about
1410 either read or write accessors.
1411 .P
1412 Servers grant file delegations when a file is opened,
1413 and can recall delegations at any time when another
1414 client wants access to the file that conflicts with
1415 any delegations already granted.
1416 Delegations on directories are not supported.
1417 .P
1418 In order to support delegation callback, the server
1419 checks the network return path to the client during
1420 the client's initial contact with the server.
1421 If contact with the client cannot be established,
1422 the server simply does not grant any delegations to
1423 that client.
1424 .SH "SECURITY CONSIDERATIONS"
1425 NFS servers control access to file data,
1426 but they depend on their RPC implementation
1427 to provide authentication of NFS requests.
1428 Traditional NFS access control mimics
1429 the standard mode bit access control provided in local file systems.
1430 Traditional RPC authentication uses a number
1431 to represent each user
1432 (usually the user's own uid),
1433 a number to represent the user's group (the user's gid),
1434 and a set of up to 16 auxiliary group numbers
1435 to represent other groups of which the user may be a member.
1436 .P
1437 Typically, file data and user ID values appear unencrypted
1438 (i.e. "in the clear") on the network.
1439 Moreover, NFS versions 2 and 3 use
1440 separate sideband protocols for mounting,
1441 locking and unlocking files,
1442 and reporting system status of clients and servers.
1443 These auxiliary protocols use no authentication.
1444 .P
1445 In addition to combining these sideband protocols with the main NFS protocol,
1446 NFS version 4 introduces more advanced forms of access control,
1447 authentication, and in-transit data protection.
1448 The NFS version 4 specification mandates support for
1449 strong authentication and security flavors
1450 that provide per-RPC integrity checking and encryption.
1451 Because NFS version 4 combines the
1452 function of the sideband protocols into the main NFS protocol,
1453 the new security features apply to all NFS version 4 operations
1454 including mounting, file locking, and so on.
1455 RPCGSS authentication can also be used with NFS versions 2 and 3,
1456 but it does not protect their sideband protocols.
1457 .P
1458 The
1459 .B sec
1460 mount option specifies the security flavor
1461 that is in effect on a given NFS mount point.
1462 Specifying
1463 .B sec=krb5
1464 provides cryptographic proof of a user's identity in each RPC request.
1465 This provides strong verification of the identity of users
1466 accessing data on the server.
1467 Note that additional configuration besides adding this mount option
1468 is required in order to enable Kerberos security.
1469 Refer to the
1470 .BR rpc.gssd (8)
1471 man page for details.
1472 .P
1473 Two additional flavors of Kerberos security are supported:
1474 .B krb5i
1475 and
1476 .BR krb5p .
1477 The
1478 .B krb5i
1479 security flavor provides a cryptographically strong guarantee
1480 that the data in each RPC request has not been tampered with.
1481 The
1482 .B krb5p
1483 security flavor encrypts every RPC request
1484 to prevent data exposure during network transit; however,
1485 expect some performance impact
1486 when using integrity checking or encryption.
1487 Similar support for other forms of cryptographic security
1488 is also available.
1489 .P
1490 The NFS version 4 protocol allows
1491 a client to renegotiate the security flavor
1492 when the client crosses into a new filesystem on the server.
1493 The newly negotiated flavor effects only accesses of the new filesystem.
1494 .P
1495 Such negotiation typically occurs when a client crosses
1496 from a server's pseudo-fs
1497 into one of the server's exported physical filesystems,
1498 which often have more restrictive security settings than the pseudo-fs.
1499 .SS "Using non-privileged source ports"
1500 NFS clients usually communicate with NFS servers via network sockets.
1501 Each end of a socket is assigned a port value, which is simply a number
1502 between 1 and 65535 that distinguishes socket endpoints at the same
1503 IP address.
1504 A socket is uniquely defined by a tuple that includes the transport
1505 protocol (TCP or UDP) and the port values and IP addresses of both
1506 endpoints.
1507 .P
1508 The NFS client can choose any source port value for its sockets,
1509 but usually chooses a
1510 .I privileged
1511 port.
1512 A privileged port is a port value less than 1024.
1513 Only a process with root privileges may create a socket
1514 with a privileged source port.
1515 .P
1516 The exact range of privileged source ports that can be chosen is
1517 set by a pair of sysctls to avoid choosing a well-known port, such as
1518 the port used by ssh.
1519 This means the number of source ports available for the NFS client,
1520 and therefore the number of socket connections that can be used
1521 at the same time,
1522 is practically limited to only a few hundred.
1523 .P
1524 As described above, the traditional default NFS authentication scheme,
1525 known as AUTH_SYS, relies on sending local UID and GID numbers to identify
1526 users making NFS requests.
1527 An NFS server assumes that if a connection comes from a privileged port,
1528 the UID and GID numbers in the NFS requests on this connection have been
1529 verified by the client's kernel or some other local authority.
1530 This is an easy system to spoof, but on a trusted physical network between
1531 trusted hosts, it is entirely adequate.
1532 .P
1533 Roughly speaking, one socket is used for each NFS mount point.
1534 If a client could use non-privileged source ports as well,
1535 the number of sockets allowed,
1536 and thus the maximum number of concurrent mount points,
1537 would be much larger.
1538 .P
1539 Using non-privileged source ports may compromise server security somewhat,
1540 since any user on AUTH_SYS mount points can now pretend to be any other
1541 when making NFS requests.
1542 Thus NFS servers do not support this by default.
1543 They explicitly allow it usually via an export option.
1544 .P
1545 To retain good security while allowing as many mount points as possible,
1546 it is best to allow non-privileged client connections only if the server
1547 and client both require strong authentication, such as Kerberos.
1548 .SS "Mounting through a firewall"
1549 A firewall may reside between an NFS client and server,
1550 or the client or server may block some of its own ports via IP
1551 filter rules.
1552 It is still possible to mount an NFS server through a firewall,
1553 though some of the
1554 .BR mount (8)
1555 command's automatic service endpoint discovery mechanisms may not work; this
1556 requires you to provide specific endpoint details via NFS mount options.
1557 .P
1558 NFS servers normally run a portmapper or rpcbind daemon to advertise
1559 their service endpoints to clients. Clients use the rpcbind daemon to determine:
1560 .IP
1561 What network port each RPC-based service is using
1562 .IP
1563 What transport protocols each RPC-based service supports
1564 .P
1565 The rpcbind daemon uses a well-known port number (111) to help clients find a service endpoint.
1566 Although NFS often uses a standard port number (2049),
1567 auxiliary services such as the NLM service can choose
1568 any unused port number at random.
1569 .P
1570 Common firewall configurations block the well-known rpcbind port.
1571 In the absense of an rpcbind service,
1572 the server administrator fixes the port number
1573 of NFS-related services so that the firewall
1574 can allow access to specific NFS service ports.
1575 Client administrators then specify the port number
1576 for the mountd service via the
1577 .BR mount (8)
1578 command's
1579 .B mountport
1580 option.
1581 It may also be necessary to enforce the use of TCP or UDP
1582 if the firewall blocks one of those transports.
1583 .SS "NFS Access Control Lists"
1584 Solaris allows NFS version 3 clients direct access
1585 to POSIX Access Control Lists stored in its local file systems.
1586 This proprietary sideband protocol, known as NFSACL,
1587 provides richer access control than mode bits.
1588 Linux implements this protocol
1589 for compatibility with the Solaris NFS implementation.
1590 The NFSACL protocol never became a standard part
1591 of the NFS version 3 specification, however.
1592 .P
1593 The NFS version 4 specification mandates a new version
1594 of Access Control Lists that are semantically richer than POSIX ACLs.
1595 NFS version 4 ACLs are not fully compatible with POSIX ACLs; as such,
1596 some translation between the two is required
1597 in an environment that mixes POSIX ACLs and NFS version 4.
1598 .SH "THE REMOUNT OPTION"
1599 Generic mount options such as
1600 .BR rw " and " sync
1601 can be modified on NFS mount points using the
1602 .BR remount
1603 option.
1604 See
1605 .BR mount (8)
1606 for more information on generic mount options.
1607 .P
1608 With few exceptions, NFS-specific options
1609 are not able to be modified during a remount.
1610 The underlying transport or NFS version
1611 cannot be changed by a remount, for example.
1612 .P
1613 Performing a remount on an NFS file system mounted with the
1614 .B noac
1615 option may have unintended consequences.
1616 The
1617 .B noac
1618 option is a combination of the generic option
1619 .BR sync ,
1620 and the NFS-specific option
1621 .BR actimeo=0 .
1622 .SS "Unmounting after a remount"
1623 For mount points that use NFS versions 2 or 3, the NFS umount subcommand
1624 depends on knowing the original set of mount options used to perform the
1625 MNT operation.
1626 These options are stored on disk by the NFS mount subcommand,
1627 and can be erased by a remount.
1628 .P
1629 To ensure that the saved mount options are not erased during a remount,
1630 specify either the local mount directory, or the server hostname and
1631 export pathname, but not both, during a remount.  For example,
1632 .P
1633 .nf
1634 .ta 8n
1635         mount -o remount,ro /mnt
1636 .fi
1637 .P
1638 merges the mount option
1639 .B ro
1640 with the mount options already saved on disk for the NFS server mounted at /mnt.
1641 .SH FILES
1642 .TP 1.5i
1643 .I /etc/fstab
1644 file system table
1645 .SH BUGS
1646 Before 2.4.7, the Linux NFS client did not support NFS over TCP.
1647 .P
1648 Before 2.4.20, the Linux NFS client used a heuristic
1649 to determine whether cached file data was still valid
1650 rather than using the standard close-to-open cache coherency method
1651 described above.
1652 .P
1653 Starting with 2.4.22, the Linux NFS client employs
1654 a Van Jacobsen-based RTT estimator to determine retransmit
1655 timeout values when using NFS over UDP.
1656 .P
1657 Before 2.6.0, the Linux NFS client did not support NFS version 4.
1658 .P
1659 Before 2.6.8, the Linux NFS client used only synchronous reads and writes
1660 when the
1661 .BR rsize " and " wsize
1662 settings were smaller than the system's page size.
1663 .P
1664 The Linux NFS client does not yet support
1665 certain optional features of the NFS version 4 protocol,
1666 such as security negotiation, server referrals, and named attributes.
1667 .SH "SEE ALSO"
1668 .BR fstab (5),
1669 .BR mount (8),
1670 .BR umount (8),
1671 .BR mount.nfs (5),
1672 .BR umount.nfs (5),
1673 .BR exports (5),
1674 .BR netconfig (5),
1675 .BR ipv6 (7),
1676 .BR nfsd (8),
1677 .BR sm-notify (8),
1678 .BR rpc.statd (8),
1679 .BR rpc.idmapd (8),
1680 .BR rpc.gssd (8),
1681 .BR rpc.svcgssd (8),
1682 .BR kerberos (1)
1683 .sp
1684 RFC 768 for the UDP specification.
1685 .br
1686 RFC 793 for the TCP specification.
1687 .br
1688 RFC 1094 for the NFS version 2 specification.
1689 .br
1690 RFC 1813 for the NFS version 3 specification.
1691 .br
1692 RFC 1832 for the XDR specification.
1693 .br
1694 RFC 1833 for the RPC bind specification.
1695 .br
1696 RFC 2203 for the RPCSEC GSS API protocol specification.
1697 .br
1698 RFC 3530 for the NFS version 4 specification.