do it right
[unix-history] / usr / src / share / man / man5 / fstab.5
CommitLineData
40eeacc1
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
6de79cf3 5.\" @(#)fstab.5 6.1 (Berkeley) %G%
40eeacc1 6.\"
6de79cf3 7.TH FSTAB 5 ""
40eeacc1
KM
8.UC 4
9.SH NAME
10fstab \- static information about the filesystems
11.SH SYNOPSIS
12.B #include <fstab.h>
13.SH DESCRIPTION
14The file
15.I /etc/fstab
16contains descriptive information about the various file
17systems.
18.I /etc/fstab
19is only
20.I read
21by programs, and not written;
22it is the duty of the system administrator to properly create
23and maintain this file.
40eeacc1
KM
24The order of records in
25.I /etc/fstab
baae7f16 26is important because
40eeacc1
KM
27.I fsck,
28.I mount,
29and
30.I umount
31sequentially iterate through
32.I /etc/fstab
33doing their thing.
34.PP
35The special file name is the
36.B block
37special file name,
38and not the character special file name.
39If a program needs the character special file name,
40the program must create it by appending a ``r'' after the
41last ``/'' in the special file name.
42.PP
43If
44.I fs_type
45is ``rw'' or ``ro'' then the file system whose name is given in the
46.I fs_file
baae7f16
KM
47field is normally mounted read-write or read-only on the
48specified special file. If
49.I fs_type
50is ``rq'', then the file system is normally mounted read-write
51with disk quotas enabled.
40eeacc1
KM
52The
53.I fs_freq
54field is used for these file systems by the
55.IR dump (8)
56command to determine which file systems need to be dumped.
57The
58.I fs_passno
59field is used by the
60.IR fsck (8)
61program to determine the order in which file system checks are done
62at reboot time.
63The root file system should be specified with a
64.I fs_passno
65of 1, and other file systems should have larger numbers. File systems
66within a drive should have distinct numbers, but file systems on different
67drives can be checked on the same pass to utilize parallelism available in
68the hardware.
69.PP
70If
71.I fs_type
baae7f16 72is ``sw'' then the special file is made available as a piece of swap
40eeacc1
KM
73space by the
74.IR swapon (8)
75command at the end of the system reboot procedure.
76The fields other than
77.I fs_spec
78and
79.I fs_type
80are not used in this case.
81.PP
baae7f16
KM
82If
83.I fs_type
84is ``rq'' then at boot time the file system is automatically
85processed by the
86.IR quotacheck (8)
87command and disk quotas are then enabled with
88.IR quotaon (8).
89File system quotas are maintained in a file ``quotas'', which is
90located at the root of the associated file system.
91.PP
92If
93.I fs_type
94is specified as ``xx'' the entry is ignored.
95This is useful to show disk partitions which are currently not used.
40eeacc1
KM
96.sp 1
97.nf
baae7f16
KM
98.DT
99#define FSTAB_RW "rw" /* read-write device */
100#define FSTAB_RO "ro" /* read-only device */
101#define FSTAB_RQ "rq" /* read-write with quotas */
102#define FSTAB_SW "sw" /* swap device */
103#define FSTAB_XX "xx" /* ignore totally */
104.PP
105.ta \w'#define 'u +\w'char\ \ 'u +\w'fs_passno; 'u
40eeacc1 106struct fstab {
baae7f16
KM
107 char *fs_spec; /* block special device name */
108 char *fs_file; /* file system path prefix */
109 char *fs_type; /* rw,ro,sw or xx */
40eeacc1
KM
110 int fs_freq; /* dump frequency, in days */
111 int fs_passno; /* pass number on parallel dump */
112};
113.fi
40eeacc1
KM
114.PP
115The proper way to read records from
116.I /etc/fstab
baae7f16
KM
117is to use the routines getfsent(), getfsspec(), getfstype(),
118and getfsfile().
40eeacc1
KM
119.SH FILES
120/etc/fstab
121.SH SEE ALSO
baae7f16 122getfsent(3X)