MOUNT(8) — MAINTENANCE COMMANDS
NAME
mount, umount − mount and dismount filesystems
SYNOPSIS
/etc/mount
/etc/mount −p
/etc/mount −a[fv][t type ]
/etc/mount [ −frv][to type options ] [ fsname ] [ dir ]
/etc/umount [ −av ] [ fsname | dir ] ...
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(4).
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 /etc/fstab for an entry whose dir or fsname field matches the given argument. For example,
mount /usr
and
mount /dev/xy0g
are shorthand for
mount /dev/xy0g /usr
if this line is in /etc/fstab
/dev/xy0g /usr 4.2 rw 1 1
MOUNT OPTIONS
−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 will be mounted.
−o The next argument is a string that specifies mount options. Valid options are: ro, rw, quota, noquota, hard, soft, rsize=n, and wsize=n. Hard, soft, rsize=n and wsize=n only make sense on nfs(4) filesystems. Options are separated by commas. The options ro and rw stand for read-only and read-write; rw is the default. Since quotas are not implemented, noquota is the default. With a hard remote mount, mount tries forever if the mountd(8c) server does not respond. Once the filesystem is mounted, access requests will retry forever if the nfsd(8) server does not respond. Hard is the default. With a soft remote mount, if the mountd(8c) server does not respond, mount forks a background copy to retry forever. Once the soft mount completes, access requests will fail with [ETIMEDOUT] if the nfsd(8) server does not respond. The rsize=n and wsize=n options can be used to set the number of bytes in a read or write operation on nfs(4) filesystems.
−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 will occur when access times are updated, whether or not any explicit write is attempted.
−t The next argument is the filesystem type. The accepted types are: 4.2, nfs, and pc; see fstab(5) for a description of the legal filesystem types.
−f Fake a new /etc/mtab entry, but do not actually mount any filesystems.
−p Print the list of mounted filesystems in a format suitable for use in /etc/fstab.
−v Verbose — mount displays a message indicating the filesystem being mounted.
UMOUNT OPTIONS
−a Attempt to unmount all the filesystems currently mounted. 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/mtabmount table
/etc/fstabfilesystem table
SEE ALSO
mount(2), nfsmount(2), unmount(2), fstab(5), mountd(8c), nfsd(8c)
BUGS
Mounting filesystems full of garbage will crash the system.
No more than one user should mount a disk partition "read-write" or the file system may become corrupted.
Sun Release 2.3 — Last change: 12 March 1985