MNTENT(5) —
NAME
mntent − static information about filesystems (NFS and AFS)
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, dump, restore, and check the consistency of file systems. It is also processed 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 would be:
/dev/hd0a / ufs rw,noquota 1 2
The entries in 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;/∗ ufs, nfs, swap, or ignore ∗/
char∗mnt_opts;/∗ ro, quota, etc. ∗/
intmnt_freq;/∗ dump frequency, in days ∗/
intmnt_passno;/∗ pass number on parallel fsck ∗/
};
There is one entry per line in the file, and the fields are separated by white space. A # as the first non-white character indicates a comment.
The mnt_opts field consists of a string of comma-separated options. Some of the options are common to all filesystem types; others make sense only for a single filesystem type. See mount(8) for a more complete description of the options available.
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.
ufs
mnt_fsnameMust be a block special device.
mnt_optsValid opts are: ro, rw, suid, nosuid, quota, noquota.
afs
mnt_fsnameA comma-separated list of afs servers.
mnt_optsValid opts are: ro, rw, suid, nosuid, cache, cache_reserve, cache%, cache_size, max_cache_size, notime, cache_files.
nfs
mnt_fsnameThe path on the server of the directory to be served.
mnt_optsValid opts: ro, rw, suid, nosuid, hard, soft, bg, fg, retry, rsize, wsize, timeo, retrans, port, intr.
dfs
mnt_fsnameMust be a block special device, or a block special device followed by an extended partition number.
mnt-optsValid opts are ro, rw, suid, nosuid, user, group, change_user, change_group, change_all, upper, noexecute, user_only, group_only.
swap
mnt_fsnameMust be a block special device swap partition.
mnt_optsIgnored.
If the mnt_type is specified as “ignore” the entry is ignored. This is useful to show disk partitions which are currently not used.
The field mnt_freq indicates how often each partition should be dumped by the dump(8) command (and triggers that command’s w option, which specifies the file systems that should be dumped). Most systems set the mnt_freq field to 1, indicating that the file systems are dumped each day.
The final field mnt_passno is used by the disk consistency check program fsck(8) to allow overlapped checking of file systems during a reboot. All file systems with mnt_passno of 1 are first checked simultaneously, then all file systems with mnt_passno of 2, and so on. It is usual to make the mnt_passno of the root file system have the value 1 and then check one file system on each available disk drive in each subsequent pass to the exhaustion of file system partitions.
/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 fsck, mount, and umount process the file sequentially; file systems must appear after file systems they are mounted within.
FILES
/etc/fstab
SEE ALSO
getmntent(3), fsatb(5), fsck(8), mount(8), quotacheck(8), quotaon(8), umount(8)
PRPQs 5799-WZQ/5799-PFF: IBM/4.3 — December 1988