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