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