MOUNT_NFS(8) | Maintenance Commands and Procedures | MOUNT_NFS(8) |
mount_nfs
— mount
remote NFS resources
mount |
[-F nfs]
[generic_options] [-o
specific_options]
resource |
mount |
[-F nfs]
[generic_options] [-o
specific_options]
mount_point |
mount |
[-F nfs]
[generic_options] [-o
specific_options] resource
mount_point |
The mount
utility attaches a named
resource to the file system 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(8) and
statd(8) daemons if they are not
already running.
If the resource is listed in the
/etc/vfstab file, the command 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 the mount_point.
host can be an IPv4 or IPv6 address string.
As IPv6 addresses already contain colons, enclose host
in a pair of square brackets when specifying an IPv6 address string.
Otherwise 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(4P) and
inet6(4P).
The mount
command maintains a table of
mounted file systems in /etc/mnttab, described in
mnttab(5).
mount_nfs
supports both NFSv3 and NFSv4
mounts. The default NFS version is NFSv4.
See mount(8) for the list of supported generic_options. See share_nfs(8) for a description of server options.
-o
specific_optionsThe following list describes specific_options:
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.
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.
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.proto is set to the value of netid or rdma. netid is the 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.
-o
options,
and this option works only on currently mounted read-only file
systems.mount
operation.
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.
The preferred mode for NFS Version 3 mounts is the default mode specified in /etc/nfssec.conf (see nfssec.conf(5)) 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 supports in the array of modes returned by the server. These alternatives are limited to the security flavors 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(7) for the available mode options.
File systems mounted with the bg option indicate
that mount
is to retry in the background if the
server's mount daemon (mountd(8)) 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, the time-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.
File 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 can incur unexpected I/O errors, file corruption, and unexpected program core dumps. The soft option is not recommended.
The server can require authenticated NFS requests from the client. sec=dh authentication might be required. See nfssec(7).
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
RFC 2054, WebNFS
Client Specification. If the server supports the public file
handle, the attempt is successful; mount
does not
need to contact the server's
rpcbind(8) and the
mountd(8) 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 outbound connections
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 according 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 RFC 1738, Uniform Resource Locators (URL).
resource 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 specified either 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 next alternate server to access files. If the read-only option is not chosen, replication is disabled. File access, for NFS Versions 2 and 3, is blocked on the original if NFS locks are active for that file.
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 temporarily out-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 flush time extension for regular files and for directories. Setting 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 is written directly to a server, where it can be viewed immediately by other clients, it has a significant adverse effect on client write performance. Data written into memory-mapped file pages (mmap(2)) are not written directly to this server.
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 attribute 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:
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).
example# mount serv:/usr/src /usr/src
example# mount -r -o nosuid serv:/usr/src /usr/src
example# mount -o vers=2,proto=udp serv:/usr/src /usr/src
example# mount nfs://serv/usr/man /usr/man
example# mount -o public nfs://serv/usr/%A0abc /mnt/test
example# mount -o public serv:C:doc:new /usr/doc
example# mount serv-a,serv-b,serv-c:/usr/man /usr/man
example# mount serv-x:/usr/man,serv-y:/var/man,nfs://serv-z/man /usr/man
rdist(1), mkdir(2), mmap(2), mount(2), open(2), umount(2), lofs(4FS), inet(4P), inet6(4P), mnttab(5), nfs(5), nfssec.conf(5), attributes(7), fsattr(7), nfssec(7), standards(7), lockd(8), mountall(8), mountd(8), nfsd(8), quota(8), statd(8)
Callaghan and Brent, RFC 2054, WebNFS Client Specification, October 1996.
Callaghan and Brent, RFC 2224, NFS URL Scheme, October 1997.
Berners-Lee, Masinter, and McCahill, RFC 1738, Uniform Resource Locators (URL), December 1994.
An NFS server should not attempt to mount its own file systems. See lofs(4FS).
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 mounted on top of the symbolic link itself.
SunOS 4.x used the biod maintenance procedure to perform parallel 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.
The NFS client service is managed by the service management facility, smf(7), 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(8). The service's status can be queried using the svcs(1) command.
March 12, 2016 | OmniOS |