2 .\" The contents of this file are subject to the terms of the
3 .\" Common Development and Distribution License (the "License").
4 .\" You may not use this file except in compliance with the License.
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7 .\" or http://www.opensolaris.org/os/licensing.
8 .\" See the License for the specific language governing permissions
9 .\" and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each
12 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
13 .\" If applicable, add the following below this CDDL HEADER, with the
14 .\" fields enclosed by brackets "[]" replaced with your own identifying
15 .\" information: Portions Copyright [yyyy] [name of copyright owner]
18 .\" Copyright 1989 AT&T
19 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved
20 .\" Copyright 2016 Nexenta Systems, Inc.
27 .Nd mount remote NFS resources
31 .Op Ar generic_options
32 .Op Fl o Ar specific_options
36 .Op Ar generic_options
37 .Op Fl o Ar specific_options
41 .Op Ar generic_options
42 .Op Fl o Ar specific_options
43 .Ar resource mount_point
47 utility attaches a named
49 to the file system hierarchy at the pathname location
51 which must already exist.
54 has any contents prior to the
56 operation, the contents remain hidden until the
58 is once again unmounted.
65 daemons if they are not already running.
67 If the resource is listed in the
69 file, the command line can specify either
82 takes the file system type from
85 If the resource is not listed in the
87 file, then the command line must specify both the
93 can be an IPv4 or IPv6 address string.
94 As IPv6 addresses already contain colons, enclose
96 in a pair of square brackets when specifying an IPv6 address string.
97 Otherwise the first occurrence of a colon can be interpreted as the separator
98 between the host name and path, for example,
99 .Li [1080::8:800:200C:417A]:tmp/file .
105 .It Ar host Ns : Ns Ar pathname
108 is the name of the NFS server host, and
110 is the path name of the directory on the server being mounted.
111 The path name is interpreted according to the server's path name parsing rules
112 and is not necessarily slash-separated, though on most servers, this is the
114 .It No nfs:// Ns Ar host Ns Oo : Ns Ar port Oc Ns / Ns Ar pathname
115 This is an NFS URL and follows the standard convention for NFS URLs as described
121 See the discussion of URLs and the public option under
123 for a more detailed discussion.
125 .Ar host Ns : Ns Ar pathname
126 .No nfs:// Ns Ar host Ns Oo : Ns Ar port Oc Ns / Ns Ar pathname
128 .Ar host Ns : Ns Ar pathname
129 is a comma-separated list of
130 .Ar host Ns : Ns Ar pathname .
131 See the discussion of replicated file systems and failover under
133 for a more detailed discussion.
134 .It Ar hostlist pathname
136 is a comma-separated list of hosts.
137 See the discussion of replicated file systems and failover under
139 for a more detailed discussion.
144 command maintains a table of mounted file systems in
150 supports both NFSv3 and NFSv4 mounts.
151 The default NFS version is NFSv4.
155 for the list of supported
156 .Ar generic_options .
159 for a description of server options.
161 .It Fl o Ar specific_options
162 Set file system specific options according to a comma-separated list with no
166 The following list describes
167 .Ar specific_options :
169 .It Sy acdirmax Ns = Ns Ar n
170 Hold cached attributes for no more than
172 seconds after directory update.
173 The default value is 60.
174 .It Sy acdirmin Ns = Ns Ar n
175 Hold cached attributes for at least
177 seconds after directory update.
178 The default value is 30.
179 .It Sy acregmax Ns = Ns Ar n
180 Hold cached attributes for no more than
182 seconds after file modification.
183 The default value is 60.
184 .It Sy acregmin Ns = Ns Ar n
185 Hold cached attributes for at least
187 seconds after file modification.
188 The default value is 3.
189 .It Sy actimeo Ns = Ns n
194 times for regular files and directories to
198 .Sx File Attributes ,
199 below, for a description of the effect of setting this option to 0.
202 .Sx Specifying Values for Attribute Cache Duration Options ,
203 below, for a description of how
204 .Sy acdirmax , acdirmin , acregmax , acregmin ,
210 .It Sy bg Ns | Ns Sy fg
211 If the first attempt fails, retry in the background, or, in the foreground.
214 .It Sy forcedirectio Ns | Ns Sy noforcedirectio
217 is specified, then for the duration of the mount, forced direct I/O is used.
218 If the filesystem is mounted using
220 data is transferred directly between client and server, with no buffering on the
222 If the filesystem is mounted using
223 .Sy noforcedirectio ,
224 data is buffered on the client.
226 is a performance option that is of benefit only in large sequential data
228 The default behavior is
229 .Sy noforcedirectio .
231 By default, the GID associated with a newly created file obeys the System V
232 semantics; that is, the GID is set to the effective GID of the calling process.
233 This behavior can be overridden on a per-directory basis by setting the set-GID
234 bit of the parent directory; in this case, the GID of a newly created file is
235 set to the GID of the parent directory
241 Files created on file systems that are mounted with the
243 option obeys BSD semantics independent of whether the set-GID bit of the parent
244 directory is set; that is, the GID is unconditionally inherited from that of the
246 .It Sy hard Ns | Ns Sy soft
247 Continue to retry requests until the server responds
249 or give up and return an error
253 Note that NFSv4 clients do not support soft mounts.
254 .It Sy intr Ns | Ns Sy nointr
257 keyboard interrupts to kill a process that is hung while waiting for a response
258 on a hard-mounted file system.
261 which makes it possible for clients to interrupt applications that can be
262 waiting for a remote mount.
264 Suppress data and attribute caching.
265 The data caching that is suppressed is the write-behind.
266 The local page cache is still maintained, but data copied into it is immediately
267 written to the server.
269 Do not perform the normal close-to-open consistency.
270 When a file is closed, all modified data associated with the file is flushed to
271 the server and not held on the client.
272 When a file is opened the client sends a request to the server to validate the
273 client's local caches.
274 This behavior ensures a file's consistency across multiple NFS clients.
277 is in effect, the client does not perform the flush on close and the request for
278 validation, allowing the possibility of differences among copies of the same
279 file as stored on multiple clients.
281 This option can be used where it can be guaranteed that accesses to a specified
282 file system are made from only one client and only that client.
283 Under such a condition, the effect of
285 can be a slight performance gain.
286 .It Sy port Ns = Ns Ar n
287 The server IP port number.
292 option is specified, and if the resource includes one or more NFS URLs, and if
293 any of the URLs include a port number, then the port number in the option and in
294 the URL must be the same.
296 Request POSIX.1 semantics for the file system.
297 Requires a mount Version 2
302 for information regarding POSIX.
303 .It Sy proto Ns = Ns Ar netid Ns | Ns Sy rdma
304 By default, the transport protocol that the NFS mount uses is the first
305 available RDMA transport supported both by the client and the server.
306 If no RDMA transport is found, then it attempts to use a TCP transport or,
307 failing that, a UDP transport, as ordered in the
310 If it does not find a connection oriented transport, it uses the first available
311 connectionless transport.
312 Use this option to override the default behavior.
315 is set to the value of
326 The UDP protocol is not supported for NFS Version 4.
327 If you specify a UDP protocol with the
329 option, NFS version 4 is not used.
333 option forces the use of the public file handle when connecting to the NFS
335 The resource specified might not have an NFS URL.
336 See the discussion of URLs and the public option under
338 for a more detailed discussion.
339 .It Sy quota Ns | Ns Sy noquota
342 to check whether the user is over quota on this file system; if the file system
343 has quotas enabled on the server, quotas are still checked for operations on
346 Remounts a read-only file system as read-write
351 This option cannot be used with other
353 options, and this option works only on currently mounted read-only file systems.
354 .It Sy retrans Ns = Ns Ar n
355 Set the number of NFS retransmissions to
357 The default value is 5.
358 For connection-oriented transports, this option has no effect because it is
359 assumed that the transport performs retransmissions on behalf of NFS.
360 .It Sy retry Ns = Ns Ar n
361 The number of times to retry the
368 The default for the automounter is 0, in other words, do not retry.
369 You might find it useful to increase this value on heavily loaded servers, where
370 automounter traffic is dropped, causing unnecessary
371 .Qq server not responding
373 .It Sy rsize Ns = Ns Ar n
374 Set the read buffer size to a maximum of
377 The default value is 1048576 when using connection-oriented transports with
378 Version 3 or Version 4 of the NFS protocol, and 32768 when using connection-less
380 The default can be negotiated down if the server prefers a smaller transfer
383 operations may not necessarily use the maximum buffer size.
384 When using Version 2, the default value is 32768 for all transports.
385 .It Sy sec Ns = Ns Ar mode
388 for NFS transactions.
391 is not specified, then the default action is to use AUTH_SYS over NFS Version 2
392 mounts, use a user-configured default
394 over NFS version 3 mounts, or to negotiate a mode over Version 4 mounts.
396 The preferred mode for NFS Version 3 mounts is the default mode specified in
402 If there is no default configured in this file or if the server does not export
403 using the client's default mode, then the client picks the first mode that it
404 supports in the array of modes returned by the server.
405 These alternatives are limited to the security flavors listed in
406 .Pa /etc/nfssec.conf .
408 NFS Version 4 mounts negotiate a security mode when the server returns an array
410 The client attempts the mount with each security mode, in order, until one is
413 Only one mode can be specified with the
422 This option has been deprecated in favor of the
423 .Sy sec Ns = Ns Sy dh
425 .It Sy timeo Ns = Ns Ar n
426 Set the NFS timeout to
429 The default value is 11 tenths of a second for connectionless transports, and
430 600 tenths of a second for connection-oriented transports.
431 This value is ignored for connectionless transports.
432 Such transports might implement their own timeouts, which are outside the
434 .It Sy vers Ns = Ns Ar "NFS version number"
435 By default, the version of NFS protocol used between the client and the server
436 is the highest one available on both systems.
437 If the NFS server does not support the client's default maximum, the next lowest
438 version attempted until a matching version is found.
441 for more information on setting default minimum and maximum client versions.
442 .It Sy wsize Ns = Ns Ar n
443 Set the write buffer size to a maximum of
446 The default value is 1048576 when using connection-oriented transports with
447 Version 3 or Version 4 of the NFS protocol, and 32768 when using connection-less
449 The default can be negotiated down if the server prefers a smaller transfer
452 operations may not necessarily use the maximum buffer size.
453 When using Version 2, the default value is 32768 for all transports.
454 .It Sy xattr Ns | Ns Sy noxattr
455 Allow or disallow the creation and manipulation of extended attributes.
460 for a description of extended attributes.
463 .Ss Background versus Foreground
464 File systems mounted with the
468 is to retry in the background if the server's mount daemon
472 retries the request up to the count specified in the
473 .Sy retry Ns = Ns Ar n
475 .Po note that the default value for
481 see the description of
485 Once the file system is mounted, each NFS request made in the kernel waits
486 .Sy timeo Ns = Ns Ar n
487 tenths of a second for a response.
488 If no response arrives, the time-out is multiplied by 2 and the request is
490 When the number of retransmissions has reached the number specified in the
491 .Sy retrans Ns = Ns Ar n
492 option, a file system mounted with the
494 option returns an error on the request; one mounted with the
496 option prints a warning message and continues to retry the request.
498 File systems that are mounted read-write or that contain executable files should
499 always be mounted with the
504 mounted file systems can incur unexpected I/O errors, file corruption, and
505 unexpected program core dumps.
508 option is not recommended.
509 .Ss Authenticated requests
510 The server can require authenticated NFS requests from the client.
511 .Sy sec Ns = Ns Sy dh
512 authentication might be required.
515 .Ss URLs and the public option
518 option is specified, or if the
520 includes and NFS URL,
522 attempts to connect to the server using the public file handle lookup protocol.
525 .%R WebNFS Client Specification
528 If the server supports the public file handle, the attempt is successful;
530 does not need to contact the server's
534 daemons to get the port number of the
536 server and the initial file handle of
539 If the NFS client and server are separated by a firewall that allows all
540 outbound connections through specific ports, such as
542 then this enables NFS operations through the firewall.
543 The public option and the NFS URL can be specified independently or together.
544 They interact as specified in the following matrix:
548 host:pathname NFS URL
550 public option Force public file Force public file
551 handle and fail handle and fail
552 mount if not supported. mount if not supported.
554 Use Native paths. Use Canonical paths.
556 default Use MOUNT protocol. Try public file handle
557 with Canonical paths.
563 A Native path is a path name that is interpreted according to conventions used
564 on the native operating system of the NFS server.
565 A Canonical path is a path name that is interpreted according to the URL rules.
568 .%R Uniform Resource Locators (URL)
571 .Ss Replicated file systems and failover
573 can list multiple read-only file systems to be used to provide data.
574 These file systems should contain equivalent directory structures and identical
576 It is also recommended that they be created by a utility such as
578 The file systems can be specified either with a comma-separated list of
580 entries and/or NFS URL entries, or with a comma-separated list of hosts, if all
581 file system names are the same.
582 If multiple file systems are named and the first server in the list is down,
583 failover uses the next alternate server to access files.
584 If the read-only option is not chosen, replication is disabled.
585 File access, for NFS Versions 2 and 3, is blocked on the original if NFS locks
586 are active for that file.
588 To improve NFS read performance, files and file attributes are cached.
589 File modification times get updated whenever a write occurs.
590 However, file access times can be temporarily out-of-date until the cache gets
593 The attribute cache retains file attributes on the client.
594 Attributes for a file are assigned a time to be flushed.
595 If the file is modified before the flush time, then the flush time is extended
596 by the time since the last modification
597 .Po under the assumption that files that changed recently are likely to change
600 There is a minimum and maximum flush time extension for regular files and for
603 .Sy actimeo Ns = Ns Ar n
606 seconds for both regular files and directories.
609 .Sy actimeo Ns = Ns Sy 0
610 disables attribute caching on the client.
611 This means that every reference to attributes is satisfied directly from the
612 server though file data is still cached.
613 While this guarantees that the client always has the latest file attributes from
614 the server, it has an adverse effect on performance through additional latency,
615 network load, and server load.
619 option also disables attribute caching, but has the further effect of disabling
620 client write caching.
621 While this guarantees that data written by an application is written directly to
622 a server, where it can be viewed immediately by other clients, it has a
623 significant adverse effect on client write performance.
624 Data written into memory-mapped file pages
626 are not written directly to this server.
627 .Ss Specifying Values for Attribute Cache Duration Options
628 The attribute cache duration options are
629 .Sy acdirmax , acdirmin , acregmax , acregmin ,
634 A value specified for
636 sets the values of all attribute cache duration options except for any of these
637 options specified following
642 For example, consider the following command:
643 .Bd -literal -offset indent
644 example# mount -o acdirmax=10,actimeo=1000 server:/path /localpath
649 is the last duration option in the command line, its value
651 becomes the setting for all of the duration options, including
654 .Bd -literal -offset indent
655 example# mount -o actimeo=1000,acdirmax=10 server:/path /localpath
662 on the command line, it is assigned the value specified
664 The remaining duration options are set to the value of
670 table of mounted file systems
671 .It Pa /etc/dfs/fstypes
672 default distributed file system type
674 table of automatically mounted resources
678 .It Sy Example 1 No Mounting an NFS File System
679 To mount an NFS file system:
681 example# mount serv:/usr/src /usr/src
685 Mounting An NFS File System Read-Only With No suid Privileges
687 To mount an NFS file system read-only with no suid privileges:
689 example# mount -r -o nosuid serv:/usr/src /usr/src
693 Mounting An NFS File System Over Version 2, with the UDP Transport
695 To mount an NFS file system over Version 2, with the UDP transport:
697 example# mount -o vers=2,proto=udp serv:/usr/src /usr/src
701 Mounting an NFS File System Using An NFS URL
703 To mount an NFS file system using an NFS URL
704 .Pq a canonical path :
706 example# mount nfs://serv/usr/man /usr/man
710 Mounting An NFS File System Forcing Use Of The Public File Handle
712 To mount an NFS file system and force the use of the public file handle
715 that has a non 7-bit ASCII escape sequence:
717 example# mount -o public nfs://serv/usr/%A0abc /mnt/test
721 Mounting an NFS File System Using a Native Path
723 To mount an NFS file system using a native path
724 .Po where the server uses colons
726 as the component separator
728 and the public file handle:
730 example# mount -o public serv:C:doc:new /usr/doc
734 Mounting a Replicated Set of NFS File Systems with the Same Pathnames
736 To mount a replicated set of NFS file systems with the same pathnames:
738 example# mount serv-a,serv-b,serv-c:/usr/man /usr/man
742 Mounting a Replicated Set of NFS File Systems with Different Pathnames
744 To mount a replicated set of NFS file systems with different pathnames:
746 example# mount serv-x:/usr/man,serv-y:/var/man,nfs://serv-z/man /usr/man
775 .%R WebNFS Client Specification
790 .%R Uniform Resource Locators (URL)
795 An NFS server should not attempt to mount its own file systems.
799 If the directory on which a file system is to be mounted is a symbolic link,
800 the file system is mounted on the directory to which the symbolic link refers,
801 rather than being mounted on top of the symbolic link itself.
805 file system is mounted read-only by the kernel during the boot process, only the
808 .Po and options that can be used in conjunction with
817 The NFS client service is managed by the service management facility,
819 under the service identifier:
820 .Bd -literal -offset indent
821 svc:/network/nfs/client:default
824 Administrative actions on this service, such as enabling, disabling, or
825 requesting restart, can be performed using
827 The service's status can be queried using the