The mount command allows mounting of both local and remote resources. Before remote resources can be mounted, the remote NFS server must first make available the desired resource for client access and that resource must be accessible. The remote resource is mounted in the local file hierarchy at the path name position mountpoint. The directory mountpoint must already exist. If mountpoint already contains data prior to the mount operation, this is concealed until the resource is unmounted again.
Only the mounting of remote resources of the file system type nfs is described here. For a description of mounting local resources of the file system types ufs or bs2fs, refer to the "POSIX Commands" manual, command mount.
If the resource is listed in the file /etc/vfstab, it is sufficient to specify either resource or mountpoint. The command then searches in the file /etc/vfstab for further specifications.
The mount command enters added file systems in the table of mounted file systems /etc/mnttab.
If the command is invoked without options, all local and remote resources currently mounted on your system are listed.
Authorization: The mounting of remote resources requires root authorization. To enter the command without options requires no special authorization.
Syntax
|
Specifies that a resource of the file system type nfs is to be mounted. If this option is not specified but resource or mountpoint is specified, the command searches in the file /etc/vfstab for a corresponding entry and mounts the resource with the file system type specified there. |
Mounting the resource with read authorization. |
A list of file system specific options which can be specified after -o. The individual options in the list are separated by commas, and are described below. |
Specifies the resource to be mounted. Remote resources are specified in the form server:pathname where server is the computer name of the NFS server providing the resource and pathname is the absolute path name of the resource. |
Specifies where the resource is to be mounted locally. An absolute path name must be specified. |
The following specific_options can be specified after -o:
rw defines read and write access, ro defines read-only access to the mounted resource. The default is rw. |
Specifies whether set s-bits are to be taken into consideration during execution (suid) or ignored (nosuid). The default is suid. |
Effects remounting of an already mounted resource if only access authorizations have been changed. |
Specifies whether, if the first mount attempt fails, a new attempt is to be made in the background (bg) or in the foreground (fg). The default is fg. |
Specifies how often an unsuccessful mount operation is to be repeated.The default is 10 000. |
Specifies the port number of the NFS server. The default is NFS_PORT (2049). |
Creation of a file whose group number (GID) corresponds to the effective GID of the caller. This setting can be invalidated in each directory by setting the s-bit for the group of the parent directory; in this case, the group number corresponds to the number of the parent directory. Files which are created in file systems, which are not mounted using the grpid option, are subject to BSD semantics, which means that the GID must be adopted by that of the parent directory. |
Defines the size of the read buffer as n bytes. The default is 8 Kbytes. |
Defines the size of the write buffer as n bytes. The default is 8 Kbytes. |
Defines the maximum value for the time which the client is to wait for execution of an NFS job. n is specified as tenths of a second. The default is 11 tenths of a second. |
Sets the number of repeated transfers for an NFS job to n. The default is 5. |
Specifies whether, if the server does not respond, an error is to be returned (soft) or whether a mount operation is to be retried until the server responds (hard). |
Specifies that NFS jobs can be aborted via the keyboard. If this option is not specified, in the case of a resource mounted with the option hard the terminal remains blocked until the job has been processed. |
Suppresses the buffering of attributes in the attribute cache. |
Mounts resources of servers using NFS protocol version 2, even if the servers support protocol version 3. |
Mounting in background or foreground
If NFS file systems are mounted with the option bg, this means that mount is to repeat the mount operation in the background if the mountd daemon of the server does not respond. mount repeats the request as often as specified by the option retry=n. As soon as the file system has been mounted, all NFS requests to the kernel wait timeo=n tenths of a second for a response. If no response is received, the wait time is multiplied by 2 and the request is transferred again. Once the number of retries reaches the number specified in the option retrans=n, a file system mounted with the option soft returns an error for the request; if the file system was mounted with the option hard, it issues a warning and continues to repeat the request.
Attribute cache
The attribute cache provides intermediate storage for file attributes for the client. Attributes relating to a file are deleted after a certain period of time. If a file is changed before the attribute cache is emptied, the emptying interval is extended by the time which has elapsed since the last change; this presupposes that recently changed files will soon be changed again. For normal files and for directories, minimum and maximum values apply to the extension of the emptying intervals.
Files
/etc/mnttab
Table of mounted file systems
/etc/dfs/fstypes
Table of installed utilities for distributed file systems
/etc/vfstab
Table of defined file systems
Examples
Example 1:
You wish to mount the directory /usr/src from the remote computer serv on your local computer in the directory /usr1/proj3/src. On the computer serv the directory has been made available by means of NFS.
$ mount -F nfs serv:/usr/src /usr1/proj3/src
Example 2:
On your computer, you wish to mount the directory /usr/man which the computer docgroup makes available via NFS. The mount operation is to be retried until the server responds. You wish to mount the directory for read-only access; interruption via the keyboard is to be possible. You create the directory /home1/usr/man as the mount point.
$ mkdir /home1/usr/man $ mount -F nfs -o ro,hard,intr docgroup:/usr/man /home1/usr/man