manpages.info - online man pages   

SunOS man pages : mount_nfs (1)

Maintenance 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. If the resource is listed in the /etc/vfstab file, the com- mand line can specify either resource or mount_point, and mount will consult /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. A named resource can have one of the following formats: host:pathname Where host is the name of the NFS server host, and pathname 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 not necessarily slash- separated, though on most servers, this will be the case. nfs://host[:port]/pathname This is an NFS URL and follows the standard con- vention for NFS URLs as described in Internet RFC 2225 - NFS URL Scheme. See the discussion of URL's and the public option under NFS FILE SYS- TEMS below for a more detailed discussion. nfs://host[:port]/pathname resources A comma- separated list of host:pathname and/or See the discussion of Replicated file systems and SunOS 5.8 Last change: 21 Aug 2001 1 Maintenance Commands mount_nfs(1M) failover under NFS FILE SYSTEMS below for a more detailed discussion. fix A comma- separated list of hosts followed by a :pathname suf- See the discussion of Replicated file systems and failover under NFS FILE SYSTEMS below for a more detailed discussion mount maintains a table of mounted file systems in /etc/mnt tab, described in mnttab(4).

OPTIONS

See mount(1M) for the list of supported generic_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=n Set min and max times for regular files and directories to n seconds. bg | fg If the first attempt fails, retry in the back- ground, or, in the foreground. The default is fg. grpid By default, the GID associated with a newly created file will obey the System V semantics; that is, the GID is set to the effective GID of the calling process. This behavior may be SunOS 5.8 Last change: 21 Aug 2001 2 Maintenance Commands mount_nfs(1M) 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 will obey BSD semantics 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. intr | nointr Allow (do not allow) keyboard interrupts to kill a process that is hung while waiting for a response on a hard-mounted file system. The default is intr, which makes it possible for clients to interrupt applications that may be waiting for a remote mount. noac Suppress data and attribute caching. nocto Do not perform the normal close-to-open con- sistency. 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 will be made from only one client and only that client. Under such a condition, the effect of -nocto can be a slight performance gain. port=n The 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 SunOS 5.8 Last change: 21 Aug 2001 3 Maintenance Commands mount_nfs(1M) 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 regard- ing POSIX. proto=<netid> <netid> is a value of network_id field from entry in the /etc/netconfig file. By default, the transport protocol used for the NFS mount will be first available connection oriented transport supported on both the client and the server. If no connection oriented transport is found, then the first available connectionless transport is used. This default behavior can be overridden with the proto=<netid> option. public The public option forces the use of the public file handle when connecting to the NFS server. The resource specified may or may not have an NFS URL. See the discussion of URL's and the public option under NFS FILE SYSTEMS below 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 will still be checked for operations on this file system. remount Remounts a read-only file system as read-write (using the rw option). This option cannot be used with 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. The default value is 5. For connection-oriented transports, this option has no effect because it is assumed that the transport will perform retransmissions on behalf of NFS. retry=n The number of times to retry the mount opera- tion. The default for the mount command is 10000. SunOS 5.8 Last change: 21 Aug 2001 4 Maintenance Commands mount_nfs(1M) 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. ro | rw resource is mounted read-only or read-write. The default is rw. rsize=n Set the read buffer size to n bytes. The default value is 32768 when using Version 3 of the NFS protocol. The default can be negotiated down if the server prefers a smaller transfer size. When using Version 2, the default value is 8192. sec=mode Set the security mode for NFS transactions. If sec= is not specified, then the default action is to use AUTH_SYS over NFS Version 2 mounts, or to negotiate a mode over NFS Version 3 mounts. NFS Version 3 mounts negotiate a security mode when the server returns an array of security modes. The client will pick the first mode in the array that is supported on the client. 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 the sec=dh option. suid | nosuid Allow or disallow setuid execution. The default is suid. timeo=n Set the NFS timeout to n tenths of a second. The default value is 11 tenths of a second for con- nectionless transports, and 600 tenths of a second for connection-oriented transports. vers=<NFS version number> By default, the version of NFS protocol used between the client and the server is the highest one available on both systems. If the NFS server does not support NFS Version 3 protocol, then the NFS mount will use NFS Version 2 protocol. wsize=n Set the write buffer size to n bytes. The SunOS 5.8 Last change: 21 Aug 2001 5 Maintenance Commands mount_nfs(1M) default value is 32768 when using Version 3 of the NFS protocol. The default can be negotiated down if the server prefers a smaller transfer size. When using Version 2, the default value is 8192. -O Overlay mount. Allow the file system to be mounted over an existing mount point, making the underlying file system inaccessible. If a mount is attempted on a pre-existing mount point without setting this flag, the mount will fail, 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 descrip- tion 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. Hard versus Soft File systems that are mounted read-write or that con- tain executable files should always be mounted with the hard option. Applications using soft mounted file systems may incur unexpected I/O errors, file corrup- tion, and unexpected program core dumps. The soft option is not recommended. Authenticated Requests The server may require authenticated NFS requests from the client. Either sec=dh or sec=krb4 authentication may 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 will attempt to connect to the server using the public file handle lookup proto- col. See Internet RFC 2054 - WebNFS Client Specifica- tion. If the server supports the public file handle, SunOS 5.8 Last change: 21 Aug 2001 6 Maintenance Commands mount_nfs(1M) the attempt is successful; mount will not need to con- tact the server's rpcbind(1M), and the mountd(1M) dae- mons 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 outbount connections through specific ports, such as NFS_PORT, then this enables NFS opera- tions 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 moun-| | | mountif not sup- | tif not supported. | | | ported. | | |____________________|______________________|______________________| | | + 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 Internet RFC 1738 - Uniform Resource Locators (URL). Also, see EXAMPLES for uses of Native and Canonical paths. Replicated file systems and failover 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 may 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 will use the next alternate server to access files. If SunOS 5.8 Last change: 21 Aug 2001 7 Maintenance Commands mount_nfs(1M) the read-only option is not chosen, replication will be disabled. File access will block on the original if NFS locks are active for that file. 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 may 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. 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 will be satis- fied directly from the server though file data will still be 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 will be 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)) will not be written directly to this server.

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 Privileges To mount an NFS file system read-only with no suid privileges: example# mount -r -o nosuid serv:/usr/src /usr/src SunOS 5.8 Last change: 21 Aug 2001 8 Maintenance Commands mount_nfs(1M) 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 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 non 7-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 an NFS file system using AUTH_KERB authentication. To mount an NFS file system using AUTH_KERB authentication: example# mount -o sec=krb4 serv:/usr/src /usr/src Example 8: 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 9: Mounting a replicated set of NFS file systems with different pathnames. To mount a replicated set of NFS file systems with different pathnames: SunOS 5.8 Last change: 21 Aug 2001 9 Maintenance Commands mount_nfs(1M) example# mount serv-x:/usr/man,serv-y:/var/man,nfs://serv-z/man /usr/man

FILES

/etc/mnttab table of mounted file systems /etc/dfs/fstypes default distributed file system type /etc/vfstab table of automatically mounted resources

ATTRIBUTES

See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________|

SEE ALSO

rdist(1), mountall(1M), mountd(1M), quota(1M), mkdir(2), mmap(2), mount(2), open(2), umount(2), mnttab(4), attributes(5) , nfssec(5), standards(5), lofs(7FS) Internet RFC 1738- Uniform Resource Locators (URL) Internet RFC 2054 - WebNFS Client Specification Internet RFC 2225 - NFS URL Scheme

NOTES

An 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 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. SunOS 5.8 Last change: 21 Aug 2001 10