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