1mount_nfs(1M)           System Administration Commands           mount_nfs(1M)
2
3
4

NAME

6       mount_nfs - mount remote NFS resources
7

SYNOPSIS

9       mount [-F nfs] [generic_options] [-o specific_options] [-O] resource
10
11
12       mount [-F nfs] [generic_options] [-o specific_options] [-O] mount_point
13
14
15       mount [-F nfs] [generic_options] [-o specific_options]
16            [-O] resource mount_point
17
18

DESCRIPTION

20       The  mount utility attaches a named resource to the file system hierar‐
21       chy at the pathname location mount_point, which must already exist.  If
22       mount_point has any contents prior to the mount operation, the contents
23       remain hidden until the resource is once again unmounted.
24
25
26       mount_nfs starts the lockd(1M) and statd(1M) daemons if  they  are  not
27       already running.
28
29
30       If the resource is listed in the /etc/vfstab file, the command line can
31       specify either resource or mount_point, and mount consults  /etc/vfstab
32       for more information. If the -F option is omitted, mount takes the file
33       system type from /etc/vfstab.
34
35
36       If the resource is not listed in the /etc/vfstab file, then the command
37       line must specify both the resource and the mount_point.
38
39
40       host  can  be an IPv4 or IPv6 address string. As IPv6 addresses already
41       contain colons, enclose host in a pair of square brackets when specify‐
42       ing  an  IPv6 address string. Otherwise the first occurrence of a colon
43       can be interpreted as the separator between the host name and path, for
44       example, [1080::8:800:200C:417A]:tmp/file. See inet(7P) and inet6(7P).
45
46       host:pathname
47
48           Where  host is the name of the NFS server host, and pathname is the
49           path name of the directory on the server being  mounted.  The  path
50           name  is  interpreted  according  to the server's path name parsing
51           rules and  is  not  necessarily  slash-separated,  though  on  most
52           servers, this is the case.
53
54
55       nfs://host[:port]/pathname
56
57           This is an NFS URL and follows the standard convention for NFS URLs
58           as described in NFS URL Scheme, RFC 2224.  See  the  discussion  of
59           URL's  and  the  public  option  under  NFS FILE SYSTEMS for a more
60           detailed discussion.
61
62
63       host:pathname nfs://host[:port]/pathname
64
65
66           host:pathname is a comma-separated list of host:pathname.
67
68           See the discussion of replicated file systems  and  failover  under
69           NFS FILE SYSTEMS for a more detailed discussion.
70
71
72       hostlist pathname
73
74           hostlist is a comma-separated list of hosts.
75
76           See  the  discussion  of replicated file systems and failover under
77           NFS FILE SYSTEMS for a more detailed discussion.
78
79
80
81       The mount  command  maintains  a  table  of  mounted  file  systems  in
82       /etc/mnttab, described in mnttab(4).
83
84
85       mount_nfs supports both NFSv3 and NFSv4 mounts. The default NFS version
86       is NFSv4.
87

OPTIONS

89       See  mount(1M)  for  the  list  of   supported   generic_options.   See
90       share_nfs(1M) for a description of server options.
91
92       -o specific_options
93
94           Set  file  system  specific  options according to a comma-separated
95           list with no intervening spaces.
96
97           acdirmax=n
98
99               Hold cached attributes for no more than n seconds after  direc‐
100               tory update. The default value is 60.
101
102
103           acdirmin=n
104
105               Hold  cached  attributes for at least n seconds after directory
106               update. The default value is 30.
107
108
109           acregmax=n
110
111               Hold cached attributes for no more than n  seconds  after  file
112               modification. The default value is 60.
113
114
115           acregmin=n
116
117               Hold  cached attributes for at least n seconds after file modi‐
118               fication. The default value is 3.
119
120
121           actimeo=n
122
123               Set min and max times for regular files and  directories  to  n
124               seconds. See "File Attributes," below, for a description of the
125               effect of setting this option to 0.
126
127               See "Specifying Values for Attribute Cache  Duration  Options,"
128               below,  for  a description of how acdirmax, acdirmin, acregmax,
129               acregmin, and actimeo are parsed on a mount command line.
130
131
132           bg | fg
133
134               If the first attempt fails, retry in the background, or, in the
135               foreground. The default is fg.
136
137
138           forcedirectio | noforcedirectio
139
140               If  forcedirectio  is  specified,  then for the duration of the
141               mount, forced direct I/O is used. If the filesystem is  mounted
142               using  forcedirectio,  data  is  transferred  directly  between
143               client and server, with no buffering  on  the  client.  If  the
144               filesystem  is  mounted using noforcedirectio, data is buffered
145               on the client. forcedirectio is a performance option that is of
146               benefit  only  in  large sequential data transfers. The default
147               behavior is noforcedirectio.
148
149
150           grpid
151
152               By default, the GID associated with a newly created file  obeys
153               the  System  V semantics; that is, the GID is set to the effec‐
154               tive GID of the calling process. This behavior can be  overrid‐
155               den  on a per-directory basis by setting the set-GID bit of the
156               parent directory; in this case, the GID of a newly created file
157               is  set  to  the  GID  of the parent directory (see open(2) and
158               mkdir(2)). Files created on file systems that are mounted  with
159               the grpid option obeys BSD semantics independent of whether the
160               set-GID bit of the parent directory is set; that is, the GID is
161               unconditionally inherited from that of the parent directory.
162
163
164           hard | soft
165
166               Continue  to retry requests until the server responds (hard) or
167               give up and return an error (soft). The default value is  hard.
168               Note that NFSv4 clients do not support soft mounts.
169
170
171           intr | nointr
172
173               Allow (do not allow) keyboard interrupts to kill a process that
174               is hung while waiting for a response  on  a  hard-mounted  file
175               system.  The  default  is  intr,  which  makes  it possible for
176               clients to interrupt applications that can  be  waiting  for  a
177               remote mount.
178
179
180           noac
181
182               Suppress  data  and attribute caching. The data caching that is
183               suppressed is the write-behind. The local page cache  is  still
184               maintained,  but  data copied into it is immediately written to
185               the server.
186
187
188           nocto
189
190               Do not perform the normal  close-to-open  consistency.  When  a
191               file  is  closed, all modified data associated with the file is
192               flushed to the server and not held on the client. When  a  file
193               is  opened the client sends a request to the server to validate
194               the client's local caches. This behavior ensures a file's  con‐
195               sistency across multiple NFS clients. When -nocto is in effect,
196               the client does not perform the flush on close and the  request
197               for  validation,  allowing  the possiblity of differences among
198               copies of the same file as stored on multiple clients.
199
200               This option can  be  used  where  it  can  be  guaranteed  that
201               accesses  to  a  specified  file  system are made from only one
202               client and only that client. Under such a condition, the effect
203               of -nocto can be a slight performance gain.
204
205
206           port=n
207
208               The server IP port number. The default is NFS_PORT. If the port
209               option is specified, and if the resource includes one  or  more
210               NFS  URLs,  and  if any of the URLs include a port number, then
211               the port number in the option and in the URL must be the same.
212
213
214           posix
215
216               Request POSIX.1 semantics for the file system. Requires a mount
217               Version 2 mountd(1M) on the server. See standards(5) for infor‐
218               mation regarding POSIX.
219
220
221           proto=netid | rdma
222
223               By default, the transport protocol that the NFS mount  uses  is
224               the first available RDMA transport supported both by the client
225               and the server. If no RDMA transport is found, then it attempts
226               to  use  a  TCP transport or, failing that, a UDP transport, as
227               ordered in the /etc/netconfig file. If it does not find a  con‐
228               nection oriented transport, it uses the first available connec‐
229               tionless transport.
230
231               Use this option to override the default behavior.
232
233               proto is set to the value of netid or rdma. netid is the  value
234               of the network_id field entry in the /etc/netconfig file.
235
236               The  UDP  protocol  is  not supported for NFS Version 4. If you
237               specify a UDP protocol with the proto option, NFS version 4  is
238               not used.
239
240
241           public
242
243               The public option forces the use of the public file handle when
244               connecting to the NFS server. The resource specified might  not
245               have  an  NFS  URL.  See  the discussion of URLs and the public
246               option under NFS FILE SYSTEMS for a more detailed discussion.
247
248
249           quota | noquota
250
251               Enable or prevent quota(1M) to check whether the user  is  over
252               quota  on  this  file  system;  if  the  file system has quotas
253               enabled on the server, quotas are still checked for  operations
254               on this file system.
255
256
257           remount
258
259               Remounts  a  read-only  file system as read-write (using the rw
260               option). This option cannot be used with other -o options,  and
261               this option works only on currently mounted read-only file sys‐
262               tems.
263
264
265           retrans=n
266
267               Set the number of NFS retransmissions to n. The  default  value
268               is  5.  For  connection-oriented transports, this option has no
269               effect because  it  is  assumed  that  the  transport  performs
270               retransmissions on behalf of NFS.
271
272
273           retry=n
274
275               The  number  of times to retry the mount operation. The default
276               for the mount command is 10000.
277
278               The default for the automounter is 0, in other  words,  do  not
279               retry. You might find it useful to increase this value on heav‐
280               ily loaded servers, where automounter traffic is dropped, caus‐
281               ing unnecessary server not responding errors.
282
283
284           rsize=n
285
286               Set  the  read buffer size to a maximum of n bytes. The default
287               value is 1048576 when  using  connection-orientated  transports
288               with Version 3 or Version 4 of the NFS protocol, and 32768 when
289               using connection-less transports. The default can be negotiated
290               down  if  the  server  prefers  a smaller transfer size. "Read"
291               operations may not necessarily use  the  maximum  buffer  size.
292               When using Version 2, the default value is 32768 for all trans‐
293               ports.
294
295
296           sec=mode
297
298               Set the security mode for NFS  transactions.  If  sec=  is  not
299               specified,  then the default action is to use AUTH_SYS over NFS
300               Version 2 mounts, use a user-configured default auth  over  NFS
301               version  3  mounts,  or  to   negotiate  a  mode over Version 4
302               mounts.
303
304               The preferred mode for NFS Version 3 mounts is the default mode
305               specified  in  /etc/nfssec.conf  (see  nfssec.conf(4))  on  the
306               client. If there is no default configured in this  file  or  if
307               the  server  does  not  export using the client's default mode,
308               then the client picks the first mode that it  supports  in  the
309               array  of  modes returned by the server. These alternatives are
310               limited to the security flavors listed in /etc/nfssec.conf.
311
312               NFS Version 4 mounts negotiate a security mode when the  server
313               returns  an  array  of  security modes. The client attempts the
314               mount with each security mode, in order, until one is  success‐
315               ful.
316
317               Only  one  mode  can  be  specified  with  the sec= option. See
318               nfssec(5) for the available mode options.
319
320
321           secure
322
323               This option has been deprecated in favor of the sec=dh option.
324
325
326           timeo=n
327
328               Set the NFS timeout to n tenths of a second. The default  value
329               is 11 tenths of a second for connectionless transports, and 600
330               tenths of a second  for  connection-oriented  transports.  This
331               value is ignored for connectionless transports. Such transports
332               might implement their own timeouts, which are outside the  con‐
333               trol of NFS.
334
335
336           vers=NFS version number
337
338               By default, the version of NFS protocol used between the client
339               and the server is the highest one available  on  both  systems.
340               The  default  maximum  for the client is Version 4. This can be
341               changed  by  setting  the   NFS_CLIENT_VERSMAX   parameter   in
342               /etc/default/nfs  to  a  valid version (2, 3, or 4). If the NFS
343               server does not support the client's default maximum, the  next
344               lowest version attempted until a matching version is found.
345
346
347           wsize=n
348
349               Set  the write buffer size to a maximum of n bytes. The default
350               value is 1048576 when  using  connection-orientated  transports
351               with Version 3 or Version 4 of the NFS protocol, and 32768 when
352               using connection-less transports. The default can be negotiated
353               down  if  the  server  prefers a smaller transfer size. "Write"
354               operations may not necessarily use  the  maximum  buffer  size.
355               When using Version 2, the default value is 32768 for all trans‐
356               ports.
357
358
359           xattr | noxattr
360
361               Allow or disallow the creation  and  manipulation  of  extended
362               attributes.  The default is xattr. See fsattr(5) for a descrip‐
363               tion of extended attributes.
364
365
366
367       -O
368
369           Overlay mount. Allow the file system to be mounted over an existing
370           mount  point,  making the underlying file system inaccessible. If a
371           mount is attempted on a pre-existing mount  point  without  setting
372           this flag, the mount fails, producing the error "device busy."
373
374

NFS FILE SYSTEMS

376       Background versus Foreground
377
378           File  systems  mounted with the bg option indicate that mount is to
379           retry in the background if the server's mount  daemon  (mountd(1M))
380           does  not respond. mount retries the request up to the count speci‐
381           fied in the retry=n option. (Note that the default value for  retry
382           differs  between mount and automount. See the description of retry,
383           above.) Once the file system is mounted, each NFS request  made  in
384           the  kernel  waits timeo=n tenths of a second for a response. If no
385           response arrives, the time-out is multiplied by 2 and  the  request
386           is  retransmitted.  When  the number of retransmissions has reached
387           the number specified in the retrans=n option, a file system mounted
388           with  the  soft option returns an error on the request; one mounted
389           with the hard option prints a  warning  message  and  continues  to
390           retry the request.
391
392
393       Hard versus Soft
394
395           File systems that are mounted read-write or that contain executable
396           files should always be mounted with the hard  option.  Applications
397           using  soft  mounted  file systems can incur unexpected I/O errors,
398           file corruption, and unexpected program core dumps. The soft option
399           is not recommended.
400
401
402       Authenticated requests
403
404           The  server can require authenticated NFS requests from the client.
405           sec=dh authentication might be required. See nfssec(5).
406
407
408       URLs and the public option
409
410           If the public option is specified, or if the resource includes  and
411           NFS  URL,  mount attempts to connect to the server using the public
412           file handle lookup protocol. See WebNFS Client  Specification,  RFC
413           2054. If the server supports the public file handle, the attempt is
414           successful; mount does not need to contact the server's rpcbind(1M)
415           and  the  mountd(1M)  daemons  to  get the port number of the mount
416           server and the initial file handle of  pathname,  respectively.  If
417           the  NFS  client and server are separated by a firewall that allows
418           all outbound connections through specific ports, such as  NFS_PORT,
419           then  this  enables NFS operations through the firewall. The public
420           option and the NFS URL can be specified independently or  together.
421           They interact as specified in the following matrix:
422
423                                Resource Style
424
425                                 host:pathname              NFS URL
426
427             public option      Force public file          Force public file
428                                 handle and fail            handle and fail
429                                 mount if not supported.    mount if not supported.
430
431                                 Use Native paths.          Use Canonical paths.
432
433             default            Use MOUNT protocol.        Try public file handle
434                                                            with Canonical paths.
435                                                            Fall back to MOUNT
436                                                            protocol if not
437                                                            supported.
438
439           A  Native path is a path name that is interpreted according to con‐
440           ventions used on the native operating system of the NFS  server.  A
441           Canonical  path is a path name that is interpreted according to the
442           URL rules. See Uniform Resource Locators (URL), RFC 1738. See   for
443           uses of Native and Canonical paths.
444
445
446       Replicated file systems and failover
447
448           resource  can  list  multiple  read−only file systems to be used to
449           provide data. These file systems should contain  equivalent  direc‐
450           tory  structures  and  identical files. It is also recommended that
451           they be created by a utility such as rdist(1). The file systems can
452           be  specified  either with a comma−separated list of host:/pathname
453           entries and/or NFS URL entries, or with a comma −separated list  of
454           hosts, if all file system names are the same. If multiple file sys‐
455           tems are named and the first server in the list is  down,  failover
456           uses  the  next  alternate server to access files. If the read−only
457           option is not chosen, replication is disabled. File access, for NFS
458           Versions  2  and  3,  is  blocked  on the original if NFS locks are
459           active for that file.
460
461
462   File Attributes
463       To improve NFS read performance, files and file attributes are  cached.
464       File  modification  times get updated whenever a write occurs. However,
465       file access times can be temporarily out-of-date until the  cache  gets
466       refreshed.
467
468
469       The  attribute  cache retains file attributes on the client. Attributes
470       for a file are assigned a time to be flushed. If the file  is  modified
471       before  the  flush  time,  then  the flush time is extended by the time
472       since the last modification  (under  the  assumption  that  files  that
473       changed  recently  are  likely  to change soon). There is a minimum and
474       maximum flush time extension for regular  files  and  for  directories.
475       Setting  actimeo=n  sets flush time to n seconds for both regular files
476       and directories.
477
478
479       Setting actimeo=0 disables attribute caching on the client. This  means
480       that  every  reference  to  attributes  is  satisfied directly from the
481       server though file data is still cached. While this guarantees that the
482       client always has the latest file attributes from the server, it has an
483       adverse effect on performance through additional latency, network load,
484       and server load.
485
486
487       Setting  the  noac  option also disables attribute caching, but has the
488       further effect of disabling client write caching. While this guarantees
489       that  data  written  by an application is written directly to a server,
490       where it can be viewed immediately by other clients, it has a  signifi‐
491       cant adverse effect on client write performance. Data written into mem‐
492       ory-mapped file pages  (mmap(2))  are  not  written  directly  to  this
493       server.
494
495   Specifying Values for Attribute Cache Duration Options
496       The  attribute cache duration options are acdirmax, acdirmin, acregmax,
497       acregmin, and actimeo, as described under OPTIONS.  A  value  specified
498       for  actimeo  sets  the  values of all attribute cache duration options
499       except for any of these options specified following actimeo on a  mount
500       command line. For example, consider the following command:
501
502         example# mount -o acdirmax=10,actimeo=1000 server:/path /localpath
503
504
505
506       Because  actimeo  is  the last duration option in the command line, its
507       value (1000) becomes the setting  for  all  of  the  duration  options,
508       including acdirmax. Now consider:
509
510         example# mount -o actimeo=1000,acdirmax=10 server:/path /localpath
511
512
513
514       Because  the acdirmax option follows actimeo on the command line, it is
515       assigned the value specified (10). The remaining duration  options  are
516       set to the value of actimeo (1000).
517

EXAMPLES

519       Example 1 Mounting an NFS File System
520
521
522       To mount an NFS file system:
523
524
525         example# mount serv:/usr/src /usr/src
526
527
528
529       Example 2 Mounting An NFS File System Read-Only With No suid Privileges
530
531
532       To mount an NFS file system read-only with no suid privileges:
533
534
535         example# mount -r -o nosuid serv:/usr/src /usr/src
536
537
538
539       Example  3  Mounting  An  NFS  File System Over Version 2, with the UDP
540       Transport
541
542
543       To mount an NFS file system over Version 2, with the UDP transport:
544
545
546         example# mount -o vers=2,proto=udp serv:/usr/src /usr/src
547
548
549
550       Example 4 Mounting an NFS File System Using An NFS URL
551
552
553       To mount an NFS file system using an NFS URL (a canonical path):
554
555
556         example# mount nfs://serv/usr/man /usr/man
557
558
559
560       Example 5 Mounting An NFS File System Forcing Use Of  The  Public  File
561       Handle
562
563
564       To mount an NFS file system and force the use of the public file handle
565       and an NFS URL (a canonical path) that has a  non  7-bit  ASCII  escape
566       sequence:
567
568
569         example# mount -o public nfs://serv/usr/%A0abc /mnt/test
570
571
572
573       Example 6 Mounting an NFS File System Using a Native Path
574
575
576       To  mount an NFS file system using a native path (where the server uses
577       colons (":") as the component separator) and the public file handle:
578
579
580         example# mount -o public serv:C:doc:new /usr/doc
581
582
583
584       Example 7 Mounting a Replicated Set of NFS File Systems with  the  Same
585       Pathnames
586
587
588       To mount a replicated set of NFS file systems with the same pathnames:
589
590
591         example# mount serv−a,serv−b,serv−c:/usr/man /usr/man
592
593
594
595       Example  8 Mounting a Replicated Set of NFS File Systems with Different
596       Pathnames
597
598
599       To mount a replicated set of NFS file systems with different pathnames:
600
601
602         example# mount serv−x:/usr/man,serv−y:/var/man,nfs://serv-z/man /usr/man
603
604
605

FILES

607       /etc/mnttab
608
609           table of mounted file systems
610
611
612       /etc/dfs/fstypes
613
614           default distributed file system type
615
616
617       /etc/vfstab
618
619           table of automatically mounted resources
620
621

ATTRIBUTES

623       See attributes(5) for descriptions of the following attributes:
624
625
626
627
628       ┌─────────────────────────────┬─────────────────────────────┐
629       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
630       ├─────────────────────────────┼─────────────────────────────┤
631       │Availability                 │SUNWnfscu                    │
632       └─────────────────────────────┴─────────────────────────────┘
633

SEE ALSO

635       rdist(1), lockd(1M),  mountall(1M),  mountd(1M),  nfsd(1M),  quota(1M),
636       statd(1M),  mkdir(2), mmap(2), mount(2), open(2), umount(2), mnttab(4),
637       nfs(4),  nfssec.conf(4),  attributes(5),  fsattr(5),  nfssec(5),  stan‐
638       dards(5), inet(7P), inet6(7P), lofs(7FS)
639
640
641       Callaghan, Brent, WebNFS Client Specification, RFC 2054, October 1996.
642
643
644       Callaghan, Brent, NFS URL Scheme, RFC 2224, October 1997.
645
646
647       Berners-Lee, Masinter & McCahill , Uniform Resource Locators (URL), RFC
648       1738, December 1994.
649

NOTES

651       An NFS server should not attempt to mount its  own  file  systems.  See
652       lofs(7FS).
653
654
655       If  the directory on which a file system is to be mounted is a symbolic
656       link, the file system is mounted on the directory to which the symbolic
657       link  refers,  rather  than  being  mounted on top of the symbolic link
658       itself.
659
660
661       SunOS 4.x used the biod maintenance procedure to perform parallel read-
662       ahead  and  write-behind  on  NFS clients. SunOS 5.x made biod obsolete
663       with multi-threaded processing, which transparently  performs  parallel
664       read-ahead and write-behind.
665
666
667       Since  the root (/) file system is mounted read-only by the kernel dur‐
668       ing the boot process, only the remount option (and options that can  be
669       used  in  conjunction  with  remount)  affect the root (/) entry in the
670       /etc/vfstab file.
671
672
673       mount_cachefs cannot be used with replicated NFS mounts or any NFS Ver‐
674       sion 4 mount.
675
676
677       The  NFS  client service is managed by the service management facility,
678       smf(5), under the service identifier:
679
680         svc:/network/nfs/client:default
681
682
683
684
685       Administrative actions on this service, such as enabling, disabling, or
686       requesting  restart,  can  be performed using svcadm(1M). The service's
687       status can be queried using the svcs(1) command.
688
689
690
691SunOS 5.11                        26 Jul 2009                    mount_nfs(1M)
Impressum