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