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