mount(1)
NAME
mount, umount - mount or unmount a file system
SYNOPSIS
mount [-m] -[apfnrvq] [-t type] [-o options] [device] [directory]
umount [-u] -[afnvq] [-t type] device|directory
DESCRIPTION
Mount and umount are used to mount and unmount filesystems, or to add and
remove swap devices.
Mount instructs the system to extend the file system hierarchy with the
files on device at directory. The previous contents of the mount point
are hidden by the device until the connection is broken by umount.
If device is prepared for use as a swap device (with mkfs(1)), then mount
and umount may be used to add and remove this swap device if called with
the option -t swap.
Both utilities maintain a table of mounted file systems in /etc/mtab to
record mounts and unmounts. Mount will use the table /etc/fstab for
default filesystems, mountpoints and options, except when called with the
remount option, then it will use /etc/mtab like umount. The table used
will be referred to as "the table." If an entry is listed in the table,
then mount need not be called with two arguments, one will do. Mount
lists /etc/mtab if called without arguments.
Permissions
Mount and umount are normally restricted to users in the operator group
(group-id 0). Normal users may be allowed to mount or unmount devices,
floppies for instance, if the user option is placed in the fstab file.
On mount the device will be checked by fsck -n under the permissions of
the user. If the check succeeds then the device will be mounted nosuid.
The user option is ignored for a privileged user.
OPTIONS
-m Do the actions of mount even if called as umount. (They are links
to each other.)
-u Do the actions of umount.
-a Work on all file systems in the table. (Forward for mount,
backwards for umount.)
-p Make mount give its output in the same form as /etc/fstab and
/etc/mtab.
-f Fake: Update mtab, but do not mount or unmount anything.
-n No update: Do the mount or unmount, but do not touch mtab.
-r This flag is for backwards compatibility, it is the same as -o ro.
It is also for backwards compatibility that options may be placed
anywhere on the argument list, because -r was usually at the end.
-v Verbose: Tell what's mounted or unmounted. This is the default for
Minix.
-q Quiet: Leave the user in the dark.
-t type
Mount only file systems of the given type. It may be dev for any
file system type (not swap), 1 for Version 1, 2 for Version 2, 1f
for V1 flex, 2f for V2 flex, swap for a swap device, or lo for a
loopback mount. If the type can't be obtained from the table then
dev is assumed. The type field in fstab may also be ignore with the
obvious meaning for the entry.
-o options
Options is a comma separated list (no spaces) of mount options.
Some of these are fstab specific.
rw, ro
Mount the file system read-write (default) or read-only.
noauto
Fstab: Do not use this entry automatically (i.e. -a). This is
the default for the root file system.
suid, nosuid
Mount the file system with set-user-id or set-group-id
execution enabled (default) or disabled. With the nosuid
option a user can be allowed to mount an fsck'd floppy with a
limited risk to security.
grpid, nogrpid
Let the group-id of a new file be inherited from the directory,
or let the group-id be inherited only if the set-group-id bit
of the directory is set (default). The group-id of a new file
is normally the effective group-id of the process making the
new file.
nf, nonf
Use a "next fit" strategy for allocating inodes and blocks, or
use a "first fit" strategy (default).
swap, noswap
The swap option lets the swap space behind the file system be
added to the system. The noswap option (default) does not add
swap space. Note the difference with the swap type. A device
that is used for swap completely is of the type swap, a device
that has both a file system and swap can have this swap added
or removed by option.
user
Allow mounts and unmounts by nonprivileged users. This implies
nosuid.
remount
Remount the file system with different options, i.e. ro may
become rw (but not vice-versa), and nosuid may become suid (or
vice-versa). Swap behind a file system may be added or
removed.
fstab
Use the options found in the fstab file. This can be used with
remount to set the options of a mounted device to those found
in the file system table. The prime use is in /etc/rc where
you can find the command mount -o remount,fstab / to remount
the root file system from the read-only state at boot to how it
should be according to the fstab.
mkfs
Make a file system on the device before mounting it. This
requires a type other than dev. This option is highly
dangerous and should probably only be used on /dev/ram.
FILES
/etc/fstab List of file systems to mount at boot time.
/etc/mtab List of mounted file systems.
SEE ALSO
df(1), mkfs(1), fsck(1), mount(2), fstab(5).
EXIT STATUS
0 No errors.
1 Errors of any kind.
2 Root device did not match the entry in fstab.
BUGS
Only allow user mounts if your users can be trusted. While it is not
possible to gain root access due to the nosuid option, it is easy for a
user to wreck the system by removing a mounted floppy. (If they can
access the floppy drive then they can also access the big red switch, so
it is wise to humour them.)
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)