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