fstab(4) fstab(4)
NAME
fstab - static information about filesystems
SYNOPSIS
#include <mntent.h>
DESCRIPTION
The file /etc/fstab describes the filesystems and swapping
partitions used by the local machine. The system
administrator can modify it with a text editor. It is read
by commands that mount, unmount, and check the consistency
of filesystems; also by the system in providing swap space.
The file consists of a number of lines like this:
fsname dir type opts freq passno
for example:
/dev/xy0a / 5.2 rw,noquota 1 2
The entries from this file are accessed using the routines
in getmntent(3), which returns a structure of the following
form:
struct mntent {
char *mnt_fsname; /* filesystem name */
char *mnt_dir; /* filesystem path prefix */
char *mnt_type; /* 4.2, 5.2, nfs, swap,
or ignore */
char *mnt_opts; /* rw, ro, noquota, quota,
hard, soft */
int mnt_freq; /* dump frequency, in days */
int mnt_passno; /* pass # on parallel fsck */
};
Fields are separated by white space; a ``#'' as the first
non-white character indicates a comment.
The mnttype field determines how the mntfsname and
mntopts fields will be interpreted. Here is a list of the
filesystem types currently supported, and the way each of
them interprets these fields:
4.2, 5.2
mnt_fsname Must be a block special device.
mnt_opts Valid options are ro,rw,quota,
NFS
mnt_fsname The path on the server of the directory to be
served.
Page 1 (last mod. 1/14/87)
fstab(4) fstab(4)
mntopts Valid options are ro,rw,quota,
noquota,hard,soft.
SWAP
mntfsname Must be a block special device swap
partition.
mntopts Ignored.
If the mnttype is specified as ignore then the entry is
ignored. This is useful to show disk partitions not
currently used.
The mntfreq and mntpassno fields are currently unused but
must be present.
The /etc/fstab file is read only by programs, and never
written; it is the duty of the system administrator to
maintain this file. The order of records in /etc/fstab is
important because fsck, mount, and umount process the file
sequentially; filesystems must appear after filesystems they
are mounted within.
FILES
/etc/fstab
SEE ALSO
getmntent(3), fsck(1M), mount(1M) .
Page 2 (last mod. 1/14/87)