System Administration Commands mount_nfs(1M)
NAME
mount_nfs - mount remote NFS resources
SYNOPSIS
mount [-F nfs] [generic_options] [-o specific_options] [-O] resource
mount [-F nfs] [generic_options] [-o specific_options] [-O] mount_point
mount [-F nfs] [generic_options] [-o specific_options]
[-O] resource mount_point
DESCRIPTION
The mount utility attaches a named resource to the file sys-
tem hierarchy at the pathname location mount_point, which
must already exist. If mount_point has any contents prior to
the mount operation, the contents remain hidden until the resource is once again unmounted.mount_nfs starts the lockd(1M) and statd(1M) daemons if they
are not already running.If the resource is listed in the /etc/vfstab file, the com-
mand line can specify either resource or mount_point, and
mount consults /etc/vfstab for more information. If the -F
option is omitted, mount takes the file system type from /etc/vfstab. If the resource is not listed in the /etc/vfstab file, then the command line must specify both the resource and themount_point.
host can be an IPv4 or IPv6 address string. As IPv6 addresses already contain colons, enclose host in a pair ofsquare brackets when specifying an IPv6 address string. Oth-
erwise the first occurrence of a colon can be interpreted as the separator between the host name and path, for example, [1080::8:800:200C:417A]:tmp/file. See inet(7P) and inet6(7P). host:pathnameWhere host is the name of the NFS server host, and path-
name is the path name of the directory on the server being mounted. The path name is interpreted according to the server's path name parsing rules and is notSunOS 5.11 Last change: 23 Aug 2010 1
System Administration Commands mount_nfs(1M)
necessarily slash-separated, though on most servers,
this is the case. nfs://host[:port]/pathname This is an NFS URL and follows the standard convention for NFS URLs as described in NFS URL Scheme, RFC 2224. See the discussion of URL's and the public option under NFS FILE SYSTEMS for a more detailed discussion. host:pathname nfs://host[:port]/pathnamehost:pathname is a comma-separated list of
host:pathname.See the discussion of replicated file systems and fail-
over under NFS FILE SYSTEMS for a more detailed discus-
sion. hostlist pathnamehostlist is a comma-separated list of hosts.
See the discussion of replicated file systems and fail-
over under NFS FILE SYSTEMS for a more detailed discus-
sion. The mount command maintains a table of mounted file systems in /etc/mnttab, described in mnttab(4).mount_nfs supports both NFSv3 and NFSv4 mounts. The default
NFS version is NFSv4. SMF Management The NFS client service is managed by the service management facility, smf(5), under the service identifier: svc:/network/nfs/client:default Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using svcadm(1M). The service's status can be queried using theSunOS 5.11 Last change: 23 Aug 2010 2
System Administration Commands mount_nfs(1M)
svcs(1) command. OPTIONSSee mount(1M) for the list of supported generic_options. See
share_nfs(1M) for a description of server options.
-o specific_options
Set file system specific options according to a comma-
separated list with no intervening spaces. acdirmax=n Hold cached attributes for no more than n seconds after directory update. The default value is 60. acdirmin=n Hold cached attributes for at least n seconds after directory update. The default value is 30. acregmax=n Hold cached attributes for no more than n seconds after file modification. The default value is 60. acregmin=n Hold cached attributes for at least n seconds after file modification. The default value is 3. actimeo=nSet min and max times for regular files and direc-
tories to n seconds. See "File Attributes," below, for a description of the effect of setting this option to 0. See "Specifying Values for Attribute Cache Duration Options," below, for a description of how acdirmax, acdirmin, acregmax, acregmin, and actimeo are parsed on a mount command line. bg | fg If the first attempt fails, retry in the background, or, in the foreground. The default is fg.SunOS 5.11 Last change: 23 Aug 2010 3
System Administration Commands mount_nfs(1M)
forcedirectio | noforcedirectio If forcedirectio is specified, then for the durationof the mount, forced direct I/O is used. If the filesystem is mounted using forcedirectio, data is transferred directly between client and server, with no buffering on the client. If the filesystem is mounted using noforcedirectio, data is buffered on the client. forcedirectio is a performance option that is of benefit only in large sequential data transfers. The default behavior is noforcedirectio. grpid By default, the GID associated with a newly created file obeys the System V semantics; that is, the GID is set to the effective GID of the calling process.
This behavior can be overridden on a per-directory
basis by setting the set-GID bit of the parent
directory; in this case, the GID of a newly created file is set to the GID of the parent directory (see open(2) and mkdir(2)). Files created on file systems that are mounted with the grpid option obeys BSDsemantics independent of whether the set-GID bit of
the parent directory is set; that is, the GID is unconditionally inherited from that of the parent directory. hard | soft Continue to retry requests until the server responds (hard) or give up and return an error (soft). The default value is hard. Note that NFSv4 clients do not support soft mounts. intr | nointr Allow (do not allow) keyboard interrupts to kill a process that is hung while waiting for a response ona hard-mounted file system. The default is intr,
which makes it possible for clients to interrupt applications that can be waiting for a remote mount. llock Use local locking (no lock manager). Note that this is a private interface.SunOS 5.11 Last change: 23 Aug 2010 4
System Administration Commands mount_nfs(1M)
noacSuppress data and attribute caching. The data cach-
ing that is suppressed is the write-behind. The
local page cache is still maintained, but data copied into it is immediately written to the server. noctoDo not perform the normal close-to-open consistency.
When a file is closed, all modified data associated with the file is flushed to the server and not held on the client. When a file is opened the client sends a request to the server to validate the client's local caches. This behavior ensures a file's consistency across multiple NFS clients. When nocto is in effect, the client does not perform the flush on close and the request for validation, allowing the possiblity of differences among copies of the same file as stored on multiple clients. This option can be used where it can be guaranteed that accesses to a specified file system are made from only one client and only that client. Under such a condition, the effect of nocto can be a slight performance gain. port=nThe server IP port number. The default is NFS_PORT.
If the port option is specified, and if the resource includes one or more NFS URLs, and if any of the URLs include a port number, then the port number in the option and in the URL must be the same. posix Request POSIX.1 semantics for the file system. Requires a mount Version 2 mountd(1M) on the server. See standards(5) for information regarding POSIX. proto=netid | rdma By default, the transport protocol that the NFS mount uses is the first available RDMA transport supported both by the client and the server. If no RDMA transport is found, then it attempts to use a TCP transport or, failing that, a UDP transport, asSunOS 5.11 Last change: 23 Aug 2010 5
System Administration Commands mount_nfs(1M)
ordered in the /etc/netconfig file. If it does not find a connection oriented transport, it uses the first available connectionless transport. Use this option to override the default behavior. proto is set to the value of netid or rdma. netid isthe value of the network_id field entry in the
/etc/netconfig file. The UDP protocol is not supported for NFS Version 4. If you specify a UDP protocol with the proto option, NFS version 4 is not used. public The public option forces the use of the public file handle when connecting to the NFS server. The resource specified might not have an NFS URL. See the discussion of URLs and the public option under NFS FILE SYSTEMS for a more detailed discussion. quota | noquota Enable or prevent quota(1M) to check whether the user is over quota on this file system; if the file system has quotas enabled on the server, quotas are still checked for operations on this file system. remountRemounts a read-only file system as read-write
(using the rw option). This option cannot be usedwith other -o options, and this option works only on
currently mounted read-only file systems.
retrans=n Set the number of NFS retransmissions to n. Thedefault value is 5. For connection-oriented tran-
sports, this option has no effect because it is assumed that the transport performs retransmissions on behalf of NFS. retry=n The number of times to retry the mount operation.SunOS 5.11 Last change: 23 Aug 2010 6
System Administration Commands mount_nfs(1M)
The default for the mount command is 10000. The default for the automounter is 0, in other words, do not retry. You might find it useful to increase this value on heavily loaded servers, where automounter traffic is dropped, causing unnecessary server not responding errors. rsize=n Set the read buffer size to a maximum of n bytes.The default value is 1048576 when using connection-
orientated transports with Version 3 or Version 4 ofthe NFS protocol, and 32768 when using connection-
less transports. The default can be negotiated down if the server prefers a smaller transfer size."Read" operations may not necessarily use the max-
imum buffer size. When using Version 2, the default value is 32768 for all transports. sec=mode Set the security mode for NFS transactions. If sec= is not specified, then the default action is to useAUTH_SYS over NFS Version 2 mounts, use a user-
configured default auth over NFS version 3 mounts, or to negotiate a mode over Version 4 mounts. The preferred mode for NFS Version 3 mounts is the default mode specified in /etc/nfssec.conf (see nfssec.conf(4)) on the client. If there is no default configured in this file or if the server does not export using the client's default mode,then the client picks the first mode that it sup-
ports in the array of modes returned by the server.These alternatives are limited to the security fla-
vors listed in /etc/nfssec.conf. NFS Version 4 mounts negotiate a security mode when the server returns an array of security modes. The client attempts the mount with each security mode, in order, until one is successful. Only one mode can be specified with the sec= option. See nfssec(5) for the available mode options. secure This option has been deprecated in favor of theSunOS 5.11 Last change: 23 Aug 2010 7
System Administration Commands mount_nfs(1M)
sec=dh option. timeo=n Set the NFS timeout to n tenths of a second. Thedefault value is 11 tenths of a second for connec-
tionless transports, and 600 tenths of a second forconnection-oriented transports. This value is
ignored for connectionless transports. Such tran-
sports might implement their own timeouts, which are outside the control of NFS. vers=NFS version number By default, the version of NFS protocol used betweenthe client and the server is the highest one avail-
able on both systems. The default maximum for the client is Version 4. This can be changed by settingclient_versmax to a valid version number (2, 3, or
4). Use the sharectl(1M) command to manipulate theclient_versmax property. If the NFS server does not
support the client's default maximum, the next lowest version attempted until a matching version is found. wsize=n Set the write buffer size to a maximum of n bytes.The default value is 1048576 when using connection-
orientated transports with Version 3 or Version 4 ofthe NFS protocol, and 32768 when using connection-
less transports. The default can be negotiated down if the server prefers a smaller transfer size."Write" operations may not necessarily use the max-
imum buffer size. When using Version 2, the default value is 32768 for all transports. xattr | noxattr Allow or disallow the creation and manipulation of extended attributes. The default is xattr. See fsattr(5) for a description of extended attributes.-O
Overlay mount. Allow the file system to be mounted overSunOS 5.11 Last change: 23 Aug 2010 8
System Administration Commands mount_nfs(1M)
an existing mount point, making the underlying file sys-
tem inaccessible. If a mount is attempted on a pre-
existing mount point without setting this flag, the mount fails, producing the error "device busy." NFS FILE SYSTEMS Background versus Foreground File systems mounted with the bg option indicate that mount is to retry in the background if the server's mount daemon (mountd(1M)) does not respond. mount retries the request up to the count specified in the retry=n option. (Note that the default value for retry differs between mount and automount. See the description of retry, above.) Once the file system is mounted, each NFS request made in the kernel waits timeo=n tenths of a second for a response. If no response arrives, thetime-out is multiplied by 2 and the request is
retransmitted. When the number of retransmissions has reached the number specified in the retrans=n option, a file system mounted with the soft option returns an error on the request; one mounted with the hard option prints a warning message and continues to retry the request. Hard versus SoftFile systems that are mounted read-write or that contain
executable files should always be mounted with the hard option. Applications using soft mounted file systems canincur unexpected I/O errors, file corruption, and unex-
pected program core dumps. The soft option is not recom-
mended. Authenticated requests The server can require authenticated NFS requests from the client. sec=dh authentication might be required. See nfssec(5). URLs and the public option If the public option is specified, or if the resource includes and NFS URL, mount attempts to connect to the server using the public file handle lookup protocol. See WebNFS Client Specification, RFC 2054. If the serversupports the public file handle, the attempt is success-
ful; mount does not need to contact the server'sSunOS 5.11 Last change: 23 Aug 2010 9
System Administration Commands mount_nfs(1M)
rpcbind(1M) and the mountd(1M) daemons to get the port number of the mount server and the initial file handle of pathname, respectively. If the NFS client and server are separated by a firewall that allows all outboundconnections through specific ports, such as NFS_PORT,
then this enables NFS operations through the firewall. The public option and the NFS URL can be specified independently or together. They interact as specified in the following matrix: Resource Style host:pathname NFS URL public option Force public file Force public file handle and fail handle and fail mount if not supported. mount if not supported. Use Native paths. Use Canonical paths. default Use MOUNT protocol. Try public file handle with Canonical paths. Fall back to MOUNT protocol if not supported.A Native path is a path name that is interpreted accord-
ing to conventions used on the native operating system of the NFS server. A Canonical path is a path name that is interpreted according to the URL rules. See Uniform Resource Locators (URL), RFC 1738. See for uses of Native and Canonical paths. Replicated file systems and failoverresource can list multiple read-only file systems to be
used to provide data. These file systems should contain equivalent directory structures and identical files. It is also recommended that they be created by a utility such as rdist(1). The file systems can be specifiedeither with a comma-separated list of host:/pathname
entries and/or NFS URL entries, or with a comma-separated list of hosts, if all file system names are
the same. If multiple file systems are named and the first server in the list is down, failover uses the nextalternate server to access files. If the read-only
option is not chosen, replication is disabled. Fileaccess, for NFS Versions 2 and 3, is blocked on the ori-
ginal if NFS locks are active for that file.SunOS 5.11 Last change: 23 Aug 2010 10
System Administration Commands mount_nfs(1M)
File Attributes To improve NFS read performance, files and file attributes are cached. File modification times get updated whenever a write occurs. However, file access times can be temporarilyout-of-date until the cache gets refreshed.
The attribute cache retains file attributes on the client. Attributes for a file are assigned a time to be flushed. If the file is modified before the flush time, then the flush time is extended by the time since the last modification (under the assumption that files that changed recently are likely to change soon). There is a minimum and maximum flushtime extension for regular files and for directories. Set-
ting actimeo=n sets flush time to n seconds for both regular files and directories. Setting actimeo=0 disables attribute caching on the client. This means that every reference to attributes is satisfied directly from the server though file data is still cached. While this guarantees that the client always has the latest file attributes from the server, it has an adverse effect on performance through additional latency, network load, and server load. Setting the noac option also disables attribute caching, but has the further effect of disabling client write caching. While this guarantees that data written by an application iswritten directly to a server, where it can be viewed immedi-
ately by other clients, it has a significant adverse effecton client write performance. Data written into memory-mapped
file pages (mmap(2)) are not written directly to this server. Specifying Values for Attribute Cache Duration Options The attribute cache duration options are acdirmax, acdirmin, acregmax, acregmin, and actimeo, as described under OPTIONS.A value specified for actimeo sets the values of all attri-
bute cache duration options except for any of these options specified following actimeo on a mount command line. For example, consider the following command:example# mount -o acdirmax=10,actimeo=1000 server:/path /localpath
Because actimeo is the last duration option in the command line, its value (1000) becomes the setting for all of the duration options, including acdirmax. Now consider:SunOS 5.11 Last change: 23 Aug 2010 11
System Administration Commands mount_nfs(1M)
example# mount -o actimeo=1000,acdirmax=10 server:/path /localpath
Because the acdirmax option follows actimeo on the command line, it is assigned the value specified (10). The remaining duration options are set to the value of actimeo (1000).EXAMPLES
Example 1 Mounting an NFS File System To mount an NFS file system:example# mount serv:/usr/src /usr/src
Example 2 Mounting An NFS File System Read-Only With No suid
PrivilegesTo mount an NFS file system read-only with no suid
privileges:example# mount -r -o nosuid serv:/usr/src /usr/src
Example 3 Mounting An NFS File System Over Version 2, with the UDP Transport To mount an NFS file system over Version 2, with the UDP transport:example# mount -o vers=2,proto=udp serv:/usr/src /usr/src
Example 4 Mounting an NFS File System Using An NFS URL To mount an NFS file system using an NFS URL (a canonical path):example# mount nfs://serv/usr/man /usr/man
SunOS 5.11 Last change: 23 Aug 2010 12
System Administration Commands mount_nfs(1M)
Example 5 Mounting An NFS File System Forcing Use Of The Public File Handle To mount an NFS file system and force the use of the public file handle and an NFS URL (a canonical path) that has a non7-bit ASCII escape sequence:
example# mount -o public nfs://serv/usr/%A0abc /mnt/test
Example 6 Mounting an NFS File System Using a Native Path To mount an NFS file system using a native path (where the server uses colons (":") as the component separator) and the public file handle:example# mount -o public serv:C:doc:new /usr/doc
Example 7 Mounting a Replicated Set of NFS File Systems with the Same Pathnames To mount a replicated set of NFS file systems with the same pathnames:example# mount serv-a,serv-b,serv-c:/usr/man /usr/man
Example 8 Mounting a Replicated Set of NFS File Systems with Different Pathnames To mount a replicated set of NFS file systems with different pathnames:example# mount serv-x:/usr/man,serv-y:/var/man,nfs://serv-z/man /usr/man
FILES /etc/mnttabSunOS 5.11 Last change: 23 Aug 2010 13
System Administration Commands mount_nfs(1M)
table of mounted file systems /etc/dfs/fstypes default distributed file system type /etc/vfstab table of automatically mounted resourcesATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | system/file-system/nfs |
|_____________________________|_____________________________|
SEE ALSO
rdist(1), lockd(1M), mountall(1M), mountd(1M), nfsd(1M), quota(1M), sharectl(1M), statd(1M), mkdir(2), mmap(2), mount(2), open(2), umount(2), mnttab(4), nfssec.conf(4), attributes(5), fsattr(5), nfssec(5), standards(5), inet(7P), inet6(7P), lofs(7FS) Callaghan, Brent, WebNFS Client Specification, RFC 2054, October 1996. Callaghan, Brent, NFS URL Scheme, RFC 2224, October 1997.Berners-Lee, Masinter & McCahill , Uniform Resource Locators
(URL), RFC 1738, December 1994. NOTESAn NFS server should not attempt to mount its own file sys-
tems. See lofs(7FS). If the directory on which a file system is to be mounted is a symbolic link, the file system is mounted on the directory to which the symbolic link refers, rather than being mountedSunOS 5.11 Last change: 23 Aug 2010 14
System Administration Commands mount_nfs(1M)
on top of the symbolic link itself. SunOS 4.x used the biod maintenance procedure to performparallel read-ahead and write-behind on NFS clients. SunOS
5.x made biod obsolete with multi-threaded processing, which
transparently performs parallel read-ahead and write-behind.
Since the root (/) file system is mounted read-only by the
kernel during the boot process, only the remount option (and options that can be used in conjunction with remount) affect the root (/) entry in the /etc/vfstab file.mount_cachefs cannot be used with replicated NFS mounts or
any NFS Version 4 mount.SunOS 5.11 Last change: 23 Aug 2010 15