MOUNT(8) — MAINTENANCE COMMANDS
NAME
mount, umount − mount and dismount filesystems
SYNOPSIS
/etc/mount [ −p ]
/etc/mount −a[fv] [ −t type ]
/etc/mount [ −frv ] [ −t type ] [ −o options ] fsname dir
/etc/mount [ −vf ] [ −o options ] fsname | dir
/etc/umount [ −t type ] [ −h host ]
/etc/umount −a[v]
/etc/umount [ −v ]
DESCRIPTION
mount announces to the system that a filesystem fsname is to be attached to the file tree at the directory dir. The directory dir must already exist. It becomes the name of the newly mounted root. The contents of dir are hidden until the filesystem is unmounted. If fsname is of the form host:path the filesystem type is assumed to be nfs.
umount announces to the system that the filesystem fsname previously mounted on directory dir should be removed. Either the filesystem name or the mounted-on directory may be used.
mount and umount maintain a table of mounted filesystems in /etc/mtab, described in mtab(5). If invoked without an argument, mount displays the table. If invoked with only one of fsname or dir mount searches the file /etc/fstab (see fstab(5)) for an entry whose dir or fsname field matches the given argument. For example, if this line is in /etc/fstab:
/dev/xy0g /usr 4.2 rw 1 1
then the commands mount /usr and mount /dev/xy0g are shorthand for mount /dev/xy0g /usr
MOUNT OPTIONS
−p Print the list of mounted filesystems in a format suitable for use in /etc/fstab.
−a Attempt to mount all the filesystems described in /etc/fstab. (In this case, fsname and dir are taken from /etc/fstab.) If a type is specified all of the filesystems in /etc/fstab with that type is mounted. Filesystems are not necessarily mounted in the order listed in /etc/fstab .
−f Fake a new /etc/mtab entry, but do not actually mount any filesystems.
−v Verbose — mount displays a message indicating the filesystem being mounted.
−t The next argument is the filesystem type. The accepted types are: 4.2, and nfs; see fstab(5) for a description of these filesystem types.
−r Mount the specified filesystem read-only. This is a shorthand for:
mount −o ro fsname dir
Physically write-protected and magnetic tape filesystems must be mounted read-only, or errors occur when access times are updated, whether or not any explicit write is attempted.
−o Specify options , a list of comma seperated words from the list below. Some options are valid for all filesystem types, while others apply to a specific type only.
options valid on all file systems (the default is rw,suid):
rwread/write.
roread-only.
suidset-uid execution allowed.
nosuidset-uid execution not allowed.
noautodo not mount this file system automatically (mount -a).
options specific to 4.2 file systems (the default is noquota).
quotausage limits enforced.
noquotausage limits not enforced.
options specific to nfs (NFS) file systems (the defaults are: fg,retry=1,timeo=7,retrans=3,port=NFS_PORT,hard with defaults for rsize and wsize set by the kernel):
bgif the first mount attempt fails, retry in the background.
fgretry in foreground.
retry=nset number times to retry mount to n.
rsize=nset read buffer size to n bytes.
wsize=nset write buffer size to n bytes.
timeo=nset NFS timeout to n tenths of a second.
retrans=n
set number of NFS retransmissions to n.
port=nset server IP port number to n.
softreturn error if server doesn’t respond.
hardretry request until server responds.
intrallow keybourd interrupts on hard mounts.
The bg option causes mount to run in the background if the server’s mountd(8) does not respond. mount attempts each request retry=n times before giving up. 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 retrans=n retransmissions have been sent with no reply a soft mounted filesystem returns an error on the request and a hard mounted filesystem prints a message and retries the request. Filesystems that are mounted rw (read-write) should use the hard option. The intr option allows keybourd interrupts to kill a process that is hung waiting for a response on a hard mounted filesystem. The number of bytes in a read or write request can be set with the rsize and wsize options.
UMOUNT OPTIONS
−h host
Unmount all filesystems listed in /etc/mtab that are remote-mounted from host.
−a Attempt to unmount all the filesystems currently mounted (listed in /etc/mtab). In this case, fsname is taken from /etc/mtab.
−v Verbose — umount displays a message indicating the filesystem being unmounted.
EXAMPLES
mount /dev/xy0g /usr mount a local disk
mount −ft 4.2 /dev/nd0 / fake an entry for nd root
mount −at 4.2 mount all 4.2 filesystems
mount −t nfs serv:/usr/src /usr/srcmount remote filesystem
mount serv:/usr/src /usr/src same as above
mount −o hard serv:/usr/src /usr/srcsame as above but hard mount
mount −p > /etc/fstab save current mount state
FILES
/etc/mtabtable of mounted filesystems
/etc/fstabtable of filesystems mounted at boot
SEE ALSO
mount(2), unmount(2), fstab(5), mountd(8C), nfsd(8C)
BUGS
Mounting filesystems full of garbage crashes the system.
No more than one ND client should mount an ND disk partition "read-write" or the file system may become corrupted.
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.
Sun Release 3.2 — Last change: 16 May 1986