MNTENT(4) — Silicon Graphics
NAME
mntent − static information about filesystems
SYNOPSIS
#include <mntent.h>
DESCRIPTION
The file /etc/fstab describes the file systems and swapping partitions used by the local machine. It is created by the system administrator using a text editor and processed by commands which mount, unmount, check consistency of, dump and restore file systems, and by the system in providing swap space.
It consists of a number of lines of the form:
fsname dir type opts freq passno
an example of which would be:
/dev/xy0a / efs rw, 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;/* file system name */
char*mnt_dir;/* file system path prefix */
char*mnt_type;/* nfs, efs, bell, or ignore */
char*mnt_opts;/* ro, quota, etc. */
intmnt_freq;/* dump frequency, in days */
intmnt_passno;/* pass number on parallel fsck */
};
The fields are separated by white space, and a ‘#’ as the first non-white character indicates a comment.
The mnt_type field determines how the mnt_fsname, and mnt_opts fields will be interpreted. Below is a list of the file system types currently supported and the way each of them interprets these fields.
efs or bell
mnt_fsnameMust be a block special device.
mnt_optsValid opts are ro, rw.
nfs
mnt_fsnameThe path on the server of the directory to be served.
mnt_optsValid opts are ro, rw, hard, soft.
If the mnt_type is specified as “ignore” the entry is ignored. This is useful to show disk partitions which are currently not used.
mnt_freq and mnt_passno are not supported.
/etc/fstab is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file. The order of records in /etc/fstab is important because mount and umount process the file sequentially; file systems must appear after file systems they are mounted within.
FILES
/etc/fstab
SEE ALSO
fsck(1M), getmntent(3), mount(1M), umount(1M)
Version 2.5r1 — October 29, 1986