xref: /original-bsd/sbin/mount/mount.8 (revision 2c12987e)
Copyright (c) 1980, 1989 The Regents of the University of California.
All rights reserved.

Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the University of California, Berkeley. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

@(#)mount.8 6.14 (Berkeley) 06/22/90

MOUNT 8 ""
C 4
NAME
mount, umount - mount and dismount file systems
SYNOPSIS
mount [ -afrwu ] [ -t nfs | ufs | external_type ]

mount [ -frwu ] special | node

mount [ -frwu ] [ -t nfs | ufs | external_type ] [ -o options ] special node

umount [ -af ] [ -t nfs | ufs | external_type ]

umount [ -f ] special | node

DESCRIPTION
Mount announces to the system that a removable file system is present on the block device special or the remote node ``rhost:path''. The file node must exist already and it must be a directory. It becomes the name of the newly mounted root. The optional arguments -r and -w indicate that the file system is to be mounted read-only or read-write, respectively. If either special or file are not provided, the appropriate information is taken from the fstab file. The -f option causes everything to be done except for the actual system call; if it's not obvious, this ``fakes'' mounting the file system. This option is useful in conjunction with the -v flag to determine what the mount command is trying to do.

The optional argument -t can be used to indicate the file system type. The type ufs is the default. If the type is not one of the internally known types, mount will attempt to execute a program in /sbin/mount_XXX where XXX is replaced by the type name. The standard mount options (see below) are parsed and passed to external program via the -F option as a decimal number. Any additional options specific to the program can be passed as a comma separated list; these options are distinguished by starting with a - (dash). Those options that take a value are specified using the syntax -option=value. For example, the mount command:

mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp

causes mount to attempt to execute:

/sbin/mount_mfs -F 8 -N -s 4000 /dev/dk0b /tmp

Options are specified by a -o argument followed by a comma separated string of options. The following options apply to any file system that is being mounted:

"noexec" 12
Do not allow execution of any binaries on the mounted file system. This options is useful for a server that has file systems containing binaries for architectures other than its own.
"nosuid" 12
Do not allow set-user-identifier or set-group-identifier bits to take effect.
"nodev" 12
Do not interpret character or block special devices on the file system. This options is useful for a server that has file systems containing special devices for architectures other than its own.
"synchronous" 12
All I/O to the file system should be done synchronously.

The -u flag indicates that the status of an already mounted file system should be changed. Any of the options above may be changed; also a file system can be changed from read-only to read-write. The set of options is determined by first extracting the options for the file system from the fstab table, then applying any options specified by the -o argument, and finally applying the -r or -w option.

The following list can be used to override the defaults for an nfs mount:

"hard" 12
I/O system calls will retry until the server responds (default)
"soft" 12
I/O system calls will fail and return errno after retrans request retransmissions
"spongy" 12
Soft semantics for the stat, lookup, fsstat, readlink and readdir filesystem operations and hard semantics for the others. This option is meant to be similar to hard, except that processes will not be hung forever when they trip over mount points to dead servers.
"bg" 12
If the first mount request times out, do retries in background
"intr" 12
I/O system calls can be interrupted.
"noconn" 12
Do not connect the socket. Used for UDP servers that send replies from a socket other than the nfs server socket.
"tcp" 12
Use TCP transport instead of UDP.
"rsize=#" 12
Set read size to # bytes.
"wsize=#" 12
Set write size to # bytes.
"retry=#" 12
Set mount retry count to #.
"retrans=#" 12
Set retransmission count for nfs rpc's to #.
"timeo=#" 12
Set initial nfs timeout to # in 0.1 sec intervals.

Umount announces to the system that the removable file system node or whatever removable file system was previously mounted on device special should be removed. If the -f option is specified for umount , the file system is forcibly unmounted. Active special devices continue to work, but all other files return errors if further accesses are attempted. The root file system cannot be forcibly unmounted.

If the -a option is present for either mount or umount, all of the file systems described in fstab are mounted or unmounted. The optional argument -t can be used to indicate that the actions should only be taken on filesystems of the specified type. More than one type may be specified in a comma separated list. The list of filesystem types can be prefixed with ``no'' to specify the filesystem types on which no action should be taken. For example, the mount command:

mount -a -t nonfs,mfs

mounts all filesystems except those of type NFS and MFS.

The system maintains a list of currently mounted file systems. If invoked without an argument, mount prints the list. The optional argument -t can be used to indicate that only filesystems of the specified type should be listed. More than one type may be specified in a comma separated list. The list of filesystem types can be prefixed with ``no'' to indicate the types of filesystems to be excluded from the listing.

Physically write-protected and magnetic tape file systems must be mounted read-only or errors will occur when access times are updated, whether or not any explicit write is attempted.

FILES
/etc/fstab file system table
"SEE ALSO"
mount(2), unmount(2), fstab(5)
BUGS
Mounting garbaged file systems will crash the system.

Mounting a root directory on a non-directory makes some apparently good path names invalid.