1 MOUNT_NFS(1M) Maintenance Commands MOUNT_NFS(1M) 2 3 4 5 NAME 6 mount_nfs - mount remote NFS resources 7 8 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 19 DESCRIPTION 20 The mount utility attaches a named resource to the file system 21 hierarchy at the pathname location mount_point, which must already 22 exist. If mount_point has any contents prior to the mount operation, 23 the contents 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 42 specifying an IPv6 address string. Otherwise the first occurrence of a 43 colon can be interpreted as the separator between the host name and 44 path, for example, [1080::8:800:200C:417A]:tmp/file. See inet(7P) and 45 inet6(7P). 46 47 host:pathname 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 This is an NFS URL and follows the standard convention for NFS URLs 57 as described in NFS URL Scheme, RFC 2224. See the discussion of 58 URL's and the public option under NFS FILE SYSTEMS for a more 59 detailed discussion. 60 61 62 host:pathname nfs://host[:port]/pathname 63 host:pathname is a comma-separated list of host:pathname. 64 65 See the discussion of replicated file systems and failover under 66 NFS FILE SYSTEMS for a more detailed discussion. 67 68 69 hostlist pathname 70 hostlist is a comma-separated list of hosts. 71 72 See the discussion of replicated file systems and failover under 73 NFS FILE SYSTEMS for a more detailed discussion. 74 75 76 77 The mount command maintains a table of mounted file systems in 78 /etc/mnttab, described in mnttab(4). 79 80 81 mount_nfs supports both NFSv3 and NFSv4 mounts. The default NFS version 82 is NFSv4. 83 84 OPTIONS 85 See mount(1M) for the list of supported generic_options. See 86 share_nfs(1M) for a description of server options. 87 88 -o specific_options 89 Set file system specific options according to a comma-separated list 90 with no intervening spaces. 91 92 acdirmax=n 93 Hold cached attributes for no more than n seconds after 94 directory update. The default value is 60. 95 96 97 acdirmin=n 98 Hold cached attributes for at least n seconds after directory 99 update. The default value is 30. 100 101 102 acregmax=n 103 Hold cached attributes for no more than n seconds after file 104 modification. The default value is 60. 105 106 107 acregmin=n 108 Hold cached attributes for at least n seconds after file 109 modification. The default value is 3. 110 111 112 actimeo=n 113 Set min and max times for regular files and directories to n 114 seconds. See "File Attributes," below, for a description of the 115 effect of setting this option to 0. 116 117 See "Specifying Values for Attribute Cache Duration Options," 118 below, for a description of how acdirmax, acdirmin, acregmax, 119 acregmin, and actimeo are parsed on a mount command line. 120 121 122 bg | fg 123 If the first attempt fails, retry in the background, or, in the 124 foreground. The default is fg. 125 126 127 forcedirectio | noforcedirectio 128 If forcedirectio is specified, then for the duration of the 129 mount, forced direct I/O is used. If the filesystem is mounted 130 using forcedirectio, data is transferred directly between 131 client and server, with no buffering on the client. If the 132 filesystem is mounted using noforcedirectio, data is buffered 133 on the client. forcedirectio is a performance option that is of 134 benefit only in large sequential data transfers. The default 135 behavior is noforcedirectio. 136 137 138 grpid 139 By default, the GID associated with a newly created file obeys 140 the System V semantics; that is, the GID is set to the 141 effective GID of the calling process. This behavior can be 142 overridden on a per-directory basis by setting the set-GID bit of 143 the parent directory; in this case, the GID of a newly created 144 file is set to the GID of the parent directory (see open(2) and 145 mkdir(2)). Files created on file systems that are mounted with 146 the grpid option obeys BSD semantics independent of whether the 147 set-GID bit of the parent directory is set; that is, the GID is 148 unconditionally inherited from that of the parent directory. 149 150 151 hard | soft 152 Continue to retry requests until the server responds (hard) or 153 give up and return an error (soft). The default value is hard. 154 Note that NFSv4 clients do not support soft mounts. 155 156 157 intr | nointr 158 Allow (do not allow) keyboard interrupts to kill a process that 159 is hung while waiting for a response on a hard-mounted file 160 system. The default is intr, which makes it possible for 161 clients to interrupt applications that can be waiting for a 162 remote mount. 163 164 165 noac 166 Suppress data and attribute caching. The data caching that is 167 suppressed is the write-behind. The local page cache is still 168 maintained, but data copied into it is immediately written to 169 the server. 170 171 172 nocto 173 Do not perform the normal close-to-open consistency. When a file 174 is closed, all modified data associated with the file is 175 flushed to the server and not held on the client. When a file 176 is opened the client sends a request to the server to validate 177 the client's local caches. This behavior ensures a file's 178 consistency across multiple NFS clients. When -nocto is in 179 effect, the client does not perform the flush on close and the 180 request for validation, allowing the possiblity of differences 181 among copies of the same file as stored on multiple clients. 182 183 This option can be used where it can be guaranteed that 184 accesses to a specified file system are made from only one 185 client and only that client. Under such a condition, the effect 186 of -nocto can be a slight performance gain. 187 188 189 port=n 190 The server IP port number. The default is NFS_PORT. If the port 191 option is specified, and if the resource includes one or more 192 NFS URLs, and if any of the URLs include a port number, then 193 the port number in the option and in the URL must be the same. 194 195 196 posix 197 Request POSIX.1 semantics for the file system. Requires a mount 198 Version 2 mountd(1M) on the server. See standards(5) for 199 information regarding POSIX. 200 201 202 proto=netid | rdma 203 By default, the transport protocol that the NFS mount uses is 204 the first available RDMA transport supported both by the client 205 and the server. If no RDMA transport is found, then it attempts 206 to use a TCP transport or, failing that, a UDP transport, as 207 ordered in the /etc/netconfig file. If it does not find a 208 connection oriented transport, it uses the first available 209 connectionless transport. 210 211 Use this option to override the default behavior. 212 213 proto is set to the value of netid or rdma. netid is the value 214 of the network_id field entry in the /etc/netconfig file. 215 216 The UDP protocol is not supported for NFS Version 4. If you 217 specify a UDP protocol with the proto option, NFS version 4 is 218 not used. 219 220 221 public 222 The public option forces the use of the public file handle when 223 connecting to the NFS server. The resource specified might not 224 have an NFS URL. See the discussion of URLs and the public 225 option under NFS FILE SYSTEMS for a more detailed discussion. 226 227 228 quota | noquota 229 Enable or prevent quota(1M) to check whether the user is over 230 quota on this file system; if the file system has quotas 231 enabled on the server, quotas are still checked for operations 232 on this file system. 233 234 235 remount 236 Remounts a read-only file system as read-write (using the rw 237 option). This option cannot be used with other -o options, and 238 this option works only on currently mounted read-only file 239 systems. 240 241 242 retrans=n 243 Set the number of NFS retransmissions to n. The default value 244 is 5. For connection-oriented transports, this option has no 245 effect because it is assumed that the transport performs 246 retransmissions on behalf of NFS. 247 248 249 retry=n 250 The number of times to retry the mount operation. The default 251 for the mount command is 10000. 252 253 The default for the automounter is 0, in other words, do not 254 retry. You might find it useful to increase this value on 255 heavily loaded servers, where automounter traffic is dropped, 256 causing unnecessary server not responding errors. 257 258 259 rsize=n 260 Set the read buffer size to a maximum of n bytes. The default 261 value is 1048576 when using connection-oriented transports with 262 Version 3 or Version 4 of the NFS protocol, and 32768 when 263 using connection-less transports. The default can be negotiated 264 down if the server prefers a smaller transfer size. "Read" 265 operations may not necessarily use the maximum buffer size. 266 When using Version 2, the default value is 32768 for all 267 transports. 268 269 270 sec=mode 271 Set the security mode for NFS transactions. If sec= is not 272 specified, then the default action is to use AUTH_SYS over NFS 273 Version 2 mounts, use a user-configured default auth over NFS 274 version 3 mounts, or to negotiate a mode over Version 4 275 mounts. 276 277 The preferred mode for NFS Version 3 mounts is the default mode 278 specified in /etc/nfssec.conf (see nfssec.conf(4)) on the 279 client. If there is no default configured in this file or if 280 the server does not export using the client's default mode, 281 then the client picks the first mode that it supports in the 282 array of modes returned by the server. These alternatives are 283 limited to the security flavors listed in /etc/nfssec.conf. 284 285 NFS Version 4 mounts negotiate a security mode when the server 286 returns an array of security modes. The client attempts the 287 mount with each security mode, in order, until one is 288 successful. 289 290 Only one mode can be specified with the sec= option. See 291 nfssec(5) for the available mode options. 292 293 294 secure 295 This option has been deprecated in favor of the sec=dh option. 296 297 298 timeo=n 299 Set the NFS timeout to n tenths of a second. The default value 300 is 11 tenths of a second for connectionless transports, and 600 301 tenths of a second for connection-oriented transports. This 302 value is ignored for connectionless transports. Such transports 303 might implement their own timeouts, which are outside the 304 control of NFS. 305 306 307 vers=NFS version number 308 By default, the version of NFS protocol used between the client 309 and the server is the highest one available on both systems. 310 The default maximum for the client is Version 4. This can be 311 changed by setting the NFS_CLIENT_VERSMAX parameter in 312 /etc/default/nfs to a valid version (2, 3, or 4). If the NFS 313 server does not support the client's default maximum, the next 314 lowest version attempted until a matching version is found. 315 316 317 wsize=n 318 Set the write buffer size to a maximum of n bytes. The default 319 value is 1048576 when using connection-oriented transports with 320 Version 3 or Version 4 of the NFS protocol, and 32768 when 321 using connection-less transports. The default can be negotiated 322 down if the server prefers a smaller transfer size. "Write" 323 operations may not necessarily use the maximum buffer size. 324 When using Version 2, the default value is 32768 for all 325 transports. 326 327 328 xattr | noxattr 329 Allow or disallow the creation and manipulation of extended 330 attributes. The default is xattr. See fsattr(5) for a 331 description of extended attributes. 332 333 334 335 -O 336 Overlay mount. Allow the file system to be mounted over an existing 337 mount point, making the underlying file system inaccessible. If a 338 mount is attempted on a pre-existing mount point without setting 339 this flag, the mount fails, producing the error "device busy." 340 341 342 NFS FILE SYSTEMS 343 Background versus Foreground 344 File systems mounted with the bg option indicate that mount is to 345 retry in the background if the server's mount daemon (mountd(1M)) 346 does not respond. mount retries the request up to the count 347 specified in the retry=n option. (Note that the default value for 348 retry differs between mount and automount. See the description of 349 retry, above.) Once the file system is mounted, each NFS request 350 made in the kernel waits timeo=n tenths of a second for a response. 351 If no response arrives, the time-out is multiplied by 2 and the 352 request is retransmitted. When the number of retransmissions has 353 reached the number specified in the retrans=n option, a file system 354 mounted with the soft option returns an error on the request; one 355 mounted with the hard option prints a warning message and continues 356 to retry the request. 357 358 359 Hard versus Soft 360 File systems that are mounted read-write or that contain executable 361 files should always be mounted with the hard option. Applications 362 using soft mounted file systems can incur unexpected I/O errors, 363 file corruption, and unexpected program core dumps. The soft option 364 is not recommended. 365 366 367 Authenticated requests 368 The server can require authenticated NFS requests from the client. 369 sec=dh authentication might be required. See nfssec(5). 370 371 372 URLs and the public option 373 If the public option is specified, or if the resource includes and 374 NFS URL, mount attempts to connect to the server using the public 375 file handle lookup protocol. See WebNFS Client Specification, RFC 376 2054. If the server supports the public file handle, the attempt is 377 successful; mount does not need to contact the server's rpcbind(1M) 378 and the mountd(1M) daemons to get the port number of the mount 379 server and the initial file handle of pathname, respectively. If 380 the NFS client and server are separated by a firewall that allows 381 all outbound connections through specific ports, such as NFS_PORT, 382 then this enables NFS operations through the firewall. The public 383 option and the NFS URL can be specified independently or together. 384 They interact as specified in the following matrix: 385 386 Resource Style 387 388 host:pathname NFS URL 389 390 public option Force public file Force public file 391 handle and fail handle and fail 392 mount if not supported. mount if not supported. 393 394 Use Native paths. Use Canonical paths. 395 396 default Use MOUNT protocol. Try public file handle 397 with Canonical paths. 398 Fall back to MOUNT 399 protocol if not 400 supported. 401 402 A Native path is a path name that is interpreted according to 403 conventions used on the native operating system of the NFS server. 404 A Canonical path is a path name that is interpreted according to 405 the URL rules. See Uniform Resource Locators (URL), RFC 1738. See 406 for uses of Native and Canonical paths. 407 408 409 Replicated file systems and failover 410 resource can list multiple readonly file systems to be used to 411 provide data. These file systems should contain equivalent 412 directory structures and identical files. It is also recommended 413 that they be created by a utility such as rdist(1). The file 414 systems can be specified either with a commaseparated list of 415 host:/pathname entries and/or NFS URL entries, or with a comma 416 separated list of hosts, if all file system names are the same. If 417 multiple file systems are named and the first server in the list is 418 down, failover uses the next alternate server to access files. If 419 the readonly option is not chosen, replication is disabled. File 420 access, for NFS Versions 2 and 3, is blocked on the original if NFS 421 locks are active for that file. 422 423 424 File Attributes 425 To improve NFS read performance, files and file attributes are cached. 426 File modification times get updated whenever a write occurs. However, 427 file access times can be temporarily out-of-date until the cache gets 428 refreshed. 429 430 431 The attribute cache retains file attributes on the client. Attributes 432 for a file are assigned a time to be flushed. If the file is modified 433 before the flush time, then the flush time is extended by the time 434 since the last modification (under the assumption that files that 435 changed recently are likely to change soon). There is a minimum and 436 maximum flush time extension for regular files and for directories. 437 Setting actimeo=n sets flush time to n seconds for both regular files 438 and directories. 439 440 441 Setting actimeo=0 disables attribute caching on the client. This means 442 that every reference to attributes is satisfied directly from the 443 server though file data is still cached. While this guarantees that the 444 client always has the latest file attributes from the server, it has an 445 adverse effect on performance through additional latency, network load, 446 and server load. 447 448 449 Setting the noac option also disables attribute caching, but has the 450 further effect of disabling client write caching. While this guarantees 451 that data written by an application is written directly to a server, 452 where it can be viewed immediately by other clients, it has a 453 significant adverse effect on client write performance. Data written 454 into memory-mapped file pages (mmap(2)) are not written directly to this 455 server. 456 457 Specifying Values for Attribute Cache Duration Options 458 The attribute cache duration options are acdirmax, acdirmin, acregmax, 459 acregmin, and actimeo, as described under OPTIONS. A value specified 460 for actimeo sets the values of all attribute cache duration options 461 except for any of these options specified following actimeo on a mount 462 command line. For example, consider the following command: 463 464 example# mount -o acdirmax=10,actimeo=1000 server:/path /localpath 465 466 467 468 Because actimeo is the last duration option in the command line, its 469 value (1000) becomes the setting for all of the duration options, 470 including acdirmax. Now consider: 471 472 example# mount -o actimeo=1000,acdirmax=10 server:/path /localpath 473 474 475 476 Because the acdirmax option follows actimeo on the command line, it is 477 assigned the value specified (10). The remaining duration options are 478 set to the value of actimeo (1000). 479 480 EXAMPLES 481 Example 1 Mounting an NFS File System 482 483 484 To mount an NFS file system: 485 486 487 example# mount serv:/usr/src /usr/src 488 489 490 491 Example 2 Mounting An NFS File System Read-Only With No suid Privileges 492 493 494 To mount an NFS file system read-only with no suid privileges: 495 496 497 example# mount -r -o nosuid serv:/usr/src /usr/src 498 499 500 501 Example 3 Mounting An NFS File System Over Version 2, with the UDP 502 Transport 503 504 505 To mount an NFS file system over Version 2, with the UDP transport: 506 507 508 example# mount -o vers=2,proto=udp serv:/usr/src /usr/src 509 510 511 512 Example 4 Mounting an NFS File System Using An NFS URL 513 514 515 To mount an NFS file system using an NFS URL (a canonical path): 516 517 518 example# mount nfs://serv/usr/man /usr/man 519 520 521 522 Example 5 Mounting An NFS File System Forcing Use Of The Public File 523 Handle 524 525 526 To mount an NFS file system and force the use of the public file handle 527 and an NFS URL (a canonical path) that has a non 7-bit ASCII escape 528 sequence: 529 530 531 example# mount -o public nfs://serv/usr/%A0abc /mnt/test 532 533 534 535 Example 6 Mounting an NFS File System Using a Native Path 536 537 538 To mount an NFS file system using a native path (where the server uses 539 colons (":") as the component separator) and the public file handle: 540 541 542 example# mount -o public serv:C:doc:new /usr/doc 543 544 545 546 Example 7 Mounting a Replicated Set of NFS File Systems with the Same 547 Pathnames 548 549 550 To mount a replicated set of NFS file systems with the same pathnames: 551 552 553 example# mount serva,servb,servc:/usr/man /usr/man 554 555 556 557 Example 8 Mounting a Replicated Set of NFS File Systems with Different 558 Pathnames 559 560 561 To mount a replicated set of NFS file systems with different pathnames: 562 563 564 example# mount servx:/usr/man,servy:/var/man,nfs://serv-z/man /usr/man 565 566 567 568 FILES 569 /etc/mnttab 570 table of mounted file systems 571 572 573 /etc/dfs/fstypes 574 default distributed file system type 575 576 577 /etc/vfstab 578 table of automatically mounted resources 579 580 581 SEE ALSO 582 rdist(1), lockd(1M), mountall(1M), mountd(1M), nfsd(1M), quota(1M), 583 statd(1M), mkdir(2), mmap(2), mount(2), open(2), umount(2), mnttab(4), 584 nfs(4), nfssec.conf(4), attributes(5), fsattr(5), nfssec(5), 585 standards(5), inet(7P), inet6(7P), lofs(7FS) 586 587 588 Callaghan, Brent, WebNFS Client Specification, RFC 2054, October 1996. 589 590 591 Callaghan, Brent, NFS URL Scheme, RFC 2224, October 1997. 592 593 594 Berners-Lee, Masinter & McCahill , Uniform Resource Locators (URL), RFC 595 1738, December 1994. 596 597 NOTES 598 An NFS server should not attempt to mount its own file systems. See 599 lofs(7FS). 600 601 602 If the directory on which a file system is to be mounted is a symbolic 603 link, the file system is mounted on the directory to which the symbolic 604 link refers, rather than being mounted on top of the symbolic link 605 itself. 606 607 608 SunOS 4.x used the biod maintenance procedure to perform parallel read- 609 ahead and write-behind on NFS clients. SunOS 5.x made biod obsolete with 610 multi-threaded processing, which transparently performs parallel read- 611 ahead and write-behind. 612 613 614 Since the root (/) file system is mounted read-only by the kernel during 615 the boot process, only the remount option (and options that can be used 616 in conjunction with remount) affect the root (/) entry in the 617 /etc/vfstab file. 618 619 620 The NFS client service is managed by the service management facility, 621 smf(5), under the service identifier: 622 623 svc:/network/nfs/client:default 624 625 626 627 628 Administrative actions on this service, such as enabling, disabling, or 629 requesting restart, can be performed using svcadm(1M). The service's 630 status can be queried using the svcs(1) command. 631 632 633 634 September 8, 2015 MOUNT_NFS(1M)