mount(1Mnfs)
mount, umount --
mount or unmount remote NFS resources
Synopsis
mount [-F nfs] [-r] [-o specific_options] [server:path | mountpoint]
mount [-F nfs] [-r] [-o specific_options] server:path mountpoint
umount [-o specific_options] {server:path | mountpoint}
Description
The NFS®-specific mount command attaches a named
path residing on machine server to the filesystem
hierarchy at the pathname location mountpoint, which must already
exist. mount maintains a table of mounted filesystems in
/etc/mnttab, described in
mnttab(4).
The NFS-specific umount command is located in
/usr/lib/fs/nfs/umount and is called by the generic
umount command. umount unmounts a filesystem and
removes the appropriate entry from /etc/mnttab.
Options
The following options are available to the mount command:
- -F
-
Specifies the File System Type (FSType). If the -F option is
omitted, mount will take the filesystem type from
/etc/vfstab if an entry exists in /etc/vfstab for the
filesystem being mounted.
- -r
-
Mount the specified filesystem read-only.
- -o
-
Specify filesystem specific options in a comma-separated list of words
from the list below.
- pre4.0
-
Allow mounting from pre-SVR4.0 systems or other older NFS
implementations. This option should be used when the NFS server does not
allow a client user to belong to more than eight groups. If the
pre4.0 option is not used with such a server, the mount
command will fail on the client and the following message will display:
nfs mount: server:path server not responding:
RPC: Authentication error; why = Invalid client credential.
- rw|ro
-
server:path is mounted read-write or read-only. The
default is rw.
- suid|nosuid
-
Execution of setuid allowed or disallowed. The default is suid.
- remount
-
If a filesystem is mounted read-only, remounts the filesystem read-write.
- bg|fg
-
If the first attempt fails, retry as a background process, or, as a
foreground process. The default isfg.
- retry=n
-
The number of times to retry the mount operation. The default is 10000.
- port=n
-
The server IP port number. The default is NFS_PORT.
- proto=netid
-
Specifies a transport provider. If not specified, mount defaults
to connectionless transports.
- grpid
-
Create a file with its GID set to the effective GID
of the calling process. This behavior may be overridden on a per-directory
basis by setting the set-GID bit of the parent directory;
in this case, the GID is set to the GID of the parent
directory (see
open(2)
and
mkdir(2)).
Files created on filesystems that are not mounted with the
grpid option will obey BSD semantics; that is, the
GID is unconditionally inherited from that of the parent directory.
- rsize=n
-
Set the read buffer size to n bytes. The default is 8192.
- wsize=n
-
Set the write buffer size to n bytes. The default is 8192.
- timeo=n
-
Set the NFS timeout to n tenths of a second. The default is 10.
- retrans=n
-
Set the number of NFS retransmissions to n for soft mounts.
The default is 5.
- soft|hard
-
Return an error if the server does not respond, or continue the retry
request until the server responds. The default is hard.
- intr
-
Allow keyboard interrupts to kill a process that is hung while waiting for
a response on a hard-mounted filesystem.
- secure
-
Use a more secure protocol for NFS transactions.
- noac
-
Suppress attribute caching.
- acregmin=n
-
Hold cached attributes for at least n seconds after file
modification. The default is 3.
- acregmax=n
-
Hold cached attributes for no more than n seconds after file
modification. The default is 60.
- acdirmin=n
-
Hold cached attributes for at least n seconds after directory
update. The default is 30.
- acdirmax=n
-
Hold cached attributes for no more than n seconds after directory
update. The default is 60.
- actimeo=n
-
Set minimum and maximum times for regular files and directories to
n seconds. This option is equivalent to setting:
acdirmin=acdirmax=acregmin=acregmax=n
- maxthreads=n
-
Set the maximum number of asynchronous I/O threads for this mount
point to n threads. The default is 4.
The following options are available to the NFS-specific mount and
umount commands:
- server:path
-
Where server is the machine that has the remote resource and
path is the pathname of the resource.
- mountpoint
-
The name of the local directory where the remote resource has been mounted.
Background vs. foreground
NFS Filesystems mounted with the bg option indicate that
mount is to retry as a background process if the server's mount
daemon,
mountd(1Mnfs),
does not respond. mount retries the request up to the count
specified in the retry=n option.
Hard vs. soft
Once the filesystem 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 filesystem
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. If an NFS server is down, a process
trying to access a filesystem from that server mounted with the
hard option will hang until the server comes up again.
Read-write vs. read-only
NFS Filesystems that are mounted rw (read-write) should use
the hard option. If the server goes down when a user is writing
a file, the write will continue when the serve comes back up, and the
data being written will not be lost.
File attributes
The attribute cache retains file attributes on the client. Attributes for
a file are assigned a time to be flushed (updated). 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 extends flush time by n
seconds for both regular files and directories.
Files
- /etc/mnttab
-
Table of mounted filesystems.
- /etc/dfs/fstypes
-
Default distributed filesystem type.
- /etc/vfstab
-
Table of automatically mounted resources.
Usage
If mountpoint has any contents prior to the mount
operation, the contents remain hidden until the server:path
is once again unmounted. If server:path is listed in
the vfstab file, the command line can specify either
server:path or mountpoint, and mount
will consult vfstab for more information.
NOTE:
If the directory on which a filesystem is to be mounted is a symbolic link,
the filesystem is mounted on the directory to which the symbolic link refers,
rather than being mounted on top of the symbolic link itself.
Only a privileged user can execute these commands.
Exit codes
The following values are returned by the NFS-specific mount
command:
- 0
-
Successful exit
- 32
-
Usage error
- 47
-
Could not open mnttab
- 48
-
Could not lock mnttab
- 70
-
Retry mount operation
- 71
-
Gave up retrying mount operation
- 72
-
Specify host:path
- 73
-
Invalid option
- 74
-
Server not responding
- 75
-
Could not get nfs service addr
- 76
-
Could not negotiate secure protocol
- 77
-
Access denied
- 78
-
No such directory
The following values are returned by the NFS-specific umount
command:
- 0
-
Successful exit
- 33
-
Usage error
- 34
-
Permission denied
- 35
-
Directory/Resource not mounted
- 36
-
Mount point busy
Warnings
If you are mounting resources from a fast server, it is advised that you
se rsize=1024,wsize=1024 mount options. This should
be used because fast servers cause data overruns on the Ethernet driver
on slow client machines. One symptom of this problem has the following
message being written to the console of the client machines:
RPC: Timed out
Another symptom of this problem may be that the client machine appears
to be hung, with the following message being written to the console of
the client machine:
NFS server hostname not responding, still trying
NOTE:
When a single file is mounted over NFS, it cannot be opened with the
O_CREAT flag.
See
open(2)
for information on O_CREAT.
Examples
To mount a remote filesystem:
mount -F nfs serv:/usr/src /usr/src
To soft mount a remote filesystem:
mount -F nfs -o soft serv:/usr/src /usr/src
To hard mount a remote filesystem:
mount -F nfs -o hard serv:/usr/src /usr/src
To mount a filesystem with rsize set to 1024 bytes:
mount -F nfs -o rsize=1024 serv:/usr/src /usr/src
To mount a filesystem and allow the mount command to only be retried 3 times:
mount -F nfs -o retry=3 serv:/usr/src /usr/src
To mount a remote filesystem using
...
mount -F nfs -o proto=xxx serv:/usr/src /usr/src
To unmount a remote filesystem with server:path
umount serv:/usr/src
where serv is the name of the server and /usr/src is the name
of the path.
To unmount a remote filesystem with mountpoint
umount /usr/src
where /usr/src is the mountpoint of the mounted resource.
References
mnttab(4),
mount(1Mnfs),
mount(2),
mountall(1M),
open(2),
umount(2),
vfstab(4)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.