Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mkdir(2)

mount(2)

unmount(2)

open(2)

fstab(5)

mtab(5)

mountd(8C)

nfsd(8)

MOUNT(8)  —  UNIX Programmer’s Manual

NAME

mount, umount − mount and dismount filesystems

SYNOPSIS

/usr/sbin/mount [ −p ]
/usr/sbin/mount −a[nv] [ −t type ]
/usr/sbin/mount [ −nrv ] [ −t type ] [ −o options ] filesystem directory
/usr/sbin/mount [ −vn ] [ −o options ] filesystem | directory

/usr/sbin/umount [ −t type ] [ −h host ]
/usr/sbin/umount −a[v]
/usr/sbin/umount [ −v ] filesystem | directory  ...

DESCRIPTION

mount attaches a named filesystem to the filesystem hierarchy at the pathname location directory, which must already exist. If directory has any contents prior to the mount operation, these remain hidden until the filesystem is once again unmounted.  If filesystem is of the form host:pathname, it is assumed to be an NFS filesystem (type nfs).

umount unmounts a currently mounted filesystem, which can be specified either as a directory or a filesystem.

mount and umount maintain a table of mounted filesystems in /etc/mtab, described in mtab(5). If invoked without an argument, mount displays the contents of this table.  If invoked with either a filesystem or directory only, mount searches the file /etc/fstab for a matching entry, and mounts the filesystem indicated in that entry on the indicated directory. 

MOUNT OPTIONS

−p Print the list of mounted filesystems in a format suitable for use in /etc/fstab.

−a All.  Attempt to mount all the filesystems described in /etc/fstab, except those marked there as noauto. If a type argument is specified with −t, mount all filesystems of that type.  Filesystems are not necessarily mounted in the order shown in /etc/fstab.

−n Mount the filesystem without making an entry in /etc/mtab.

−v Verbose.  Display a message indicating each filesystem being mounted. 

−t type
Specify a filesystem type.  The accepted types are 4.3, and nfs; see fstab(5) for a description of these types.

−r Mount the specified filesystem read-only, even if the entry in /etc/fstab specifies that it is to be mounted read-write. 

Physically write-protected and magnetic-tape filesystems must be mounted read-only. Otherwise errors occur when the system attempts to update access times, even if no write operation is attempted. 

−o options
Specify filesystem options — list of comma-separated 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 filesystems:

rw|ro Read/write or read-only. 

suid|nosuid Setuid execution allowed or disallowed. 

grpid Create files with BSD semantics for the propagation of the  group ID.  Under this option, files inherit the GID of the directory in which they are created, regardless of the directory’s set-GID bit. 

noauto This option is ignored in the context of a mount command; it is used in /etc/fstab to indicate that a filesystem should not be mounted by a mount -a command, as described above. 

remount Remount this file system, which is currently mounted read-only.  If the file system is currently mounted, and if the entry in /etc/fstab specifies that it is to be mounted read-write or rw was specified along with remount, remount the file system making it read-write.  If the entry in /etc/fstab specifies that it is to be mounted read-only and rw was not specified, the file system is not remounted.  If the file system is not currently mounted, an error results. 

The default is ‘rw,suid’. 

options specific to 4.3 filesystems:

quota|noquota
Usage limits are enforced, or are not enforced. The default is noquota. 

options specific to nfs (NFS)filesystems:

bg|fg If the first attempt fails, retry in the background, or, in the foreground. 

retry=n The number of times to retry the mount operation. 

rsize=n Set the read buffer size to n bytes. 

wsize=n Set the write buffer size to n bytes. 

timeo=n Set the NFS timeout to n tenths of a second. 

retrans=n The number of NFS retransmissions. 

port=n The server IP port number. 

soft|hard Return an error if the server does not respond, or continue the retry request until the server responds. 

intr Allow keyboard interrupts on hard mounts. 

secure Use a more secure protocol for NFS transactions. 

acregmin=n Hold cached attributes for at least n seconds after file modification. 

acregmax=n Hold cached attributes for no more than n seconds after file modification. 

acdirmin=n Hold cached attributes for at least n seconds after directory update. 

acdirmax=n Hold cached attributes for no more than n seconds after directory update. 

actimeo=n Set min and max times for regular files and directories to n seconds. 

Regular defaults are:

fg,retry=10000,timeo=7,retrans=3,port=NFS_PORT,hard,\
acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

Defaults for rsize and wsize are set internally by the system kernel. 

UMOUNT OPTIONS

−h host
Unmount all filesystems listed in /etc/mtab that are remote-mounted from host.

−t type
Unmount all filesystems listed in /etc/mtab that are of a given type.

−a Unmount all filesystems currently mounted (as listed in /etc/mtab).

−v Verbose.  Display a message indicating each filesystem being unmounted. 

NFS FILESYSTEMS

Background vs. Foreground

Filesystems mounted with the bg option indicate that mount is to retry in the background if the server’s mount daemon (mountd(8c)) does not respond.  mount retries the request up to the count specified in the retry=n option.  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 the number of retransmissions has reached the number specified in the retrans=n option, a filesystem mounted with the soft option returns an error on the request; one mounted with the hard option prints a warning message and continues to retry the request. 

Read-Write vs. Read-Only

Filesystems that are mounted rw (read-write) should use the hard option. 

Interrupting Processes With Pending NFS Requests

The intr option allows keyboard interrupts to kill a process that is hung while waiting for a response on a hard-mounted filesystem. 

Secure Filesystems

The secure option must be given if the server requires secure mounting for the filesystem. 

File Attributes

The attribute cache retains file attributes on the client.  Attributes for a file are assigned a time to be flushed.  If the file is modified before the flush time, then the flush time is extended by the time since the last modification (under the assumption that files that changed recently are likely to change soon).  There is a minimum and maximum flush time extension for regular files and for directories.  Setting actimeo=n extends flush time by n seconds for both regular files and directories. 

EXAMPLES

To mount a local disk: mount /dev/hp0g /usr

To mount all 4.3 filesystems: mount −at 4.3

To mount a remote filesystem: mount −t nfs serv:/usr/src /usr/src

To mount a remote filesystem: mount serv:/usr/src /usr/src

To hard mount a remote filesystem:
mount −o hard serv:/usr/src /usr/src

To save current mount state: mount −p > /etc/fstab

FILES

/etc/mtab table of mounted filesystems

/etc/fstab table of filesystems mounted at boot

SEE ALSO

mkdir(2), mount(2), unmount(2), open(2), fstab(5), mtab(5), mountd(8C), nfsd(8)

BUGS

Mounting filesystems full of garbage crashes the system. 

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. 

7th Edition  —  Revision 1.10 of 10/10/90

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026