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