]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man5/fstab.5
Spell .Xr without a '/'.
[FreeBSD/FreeBSD.git] / share / man / man5 / fstab.5
1 .\" Copyright (c) 1980, 1989, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)fstab.5     8.1 (Berkeley) 6/5/93
33 .\" $FreeBSD$
34 .\"
35 .Dd June 5, 1993
36 .Dt FSTAB 5
37 .Os
38 .Sh NAME
39 .Nm fstab
40 .Nd static information about the file systems
41 .Sh SYNOPSIS
42 .In fstab.h
43 .Sh DESCRIPTION
44 The file
45 .Nm
46 contains descriptive information about the various file
47 systems.
48 .Nm
49 is only read by programs, and not written;
50 it is the duty of the system administrator to properly create
51 and maintain this file.
52 Each file system is described on a separate line;
53 fields on each line are separated by tabs or spaces.
54 The order of records in
55 .Nm
56 is important because
57 .Xr fsck 8 ,
58 .Xr mount 8 ,
59 and
60 .Xr umount 8
61 sequentially iterate through
62 .Nm
63 doing their thing.
64 .Pp
65 The first field,
66 .Pq Fa fs_spec ,
67 describes the block special device or
68 remote file system to be mounted.
69 For file systems of type
70 .Em ufs ,
71 the special file name is the block special file name,
72 and not the character special file name.
73 If a program needs the character special file name,
74 the program must create it by appending a ``r'' after the
75 last ``/'' in the special file name.
76 .Pp
77 The second field,
78 .Pq Fa fs_file ,
79 describes the mount point for the file system.
80 For swap partitions, this field should be specified as ``none''.
81 .Pp
82 The third field,
83 .Pq Fa fs_vfstype ,
84 describes the type of the file system.
85 The system can support various file system types.
86 Only the root, /usr, and /tmp file systems need be statically
87 compiled into the kernel;
88 everything else will be automatically loaded at mount
89 time.
90 (Exception: the UFS family - FFS and LFS cannot
91 currently be demand-loaded.)
92 Some people still prefer to statically
93 compile other file systems as well.
94 .Pp
95 The fourth field,
96 .Pq Fa fs_mntops ,
97 describes the mount options associated with the file system.
98 It is formatted as a comma separated list of options.
99 It contains at least the type of mount (see
100 .Fa fs_type
101 below) plus any additional options
102 appropriate to the file system type.
103 See the options flag
104 .Pq Fl o
105 in the
106 .Xr mount 8
107 page and the file system specific page, such as
108 .Xr mount_nfs 8 ,
109 for additional options that may be specified.
110 .Pp
111 If the options ``userquota'' and/or ``groupquota'' are specified,
112 the file system is automatically processed by the
113 .Xr quotacheck 8
114 command, and user and/or group disk quotas are enabled with
115 .Xr quotaon 8 .
116 By default,
117 file system quotas are maintained in files named
118 .Pa quota.user
119 and
120 .Pa quota.group
121 which are located at the root of the associated file system.
122 These defaults may be overridden by putting an equal sign
123 and an alternative absolute pathname following the quota option.
124 Thus, if the user quota file for
125 .Pa /tmp
126 is stored in
127 .Pa /var/quotas/tmp.user ,
128 this location can be specified as:
129 .Bd -literal -offset indent
130 userquota=/var/quotas/tmp.user
131 .Ed
132 .Pp
133 If the option ``noauto'' is specified, the file system will not be automatically
134 mounted at system startup.
135 Note that, for network file systems
136 of third party types
137 (i.e., types supported by additional software
138 not included in the base system)
139 to be automatically mounted at system startup,
140 the
141 .Va extra_netfs_types
142 .Xr rc.conf 5
143 variable must be used to extend the
144 .Xr rc 8
145 startup script's list of network file system types.
146 .Pp
147 The type of the mount is extracted from the
148 .Fa fs_mntops
149 field and stored separately in the
150 .Fa fs_type
151 field (it is not deleted from the
152 .Fa fs_mntops
153 field).
154 If
155 .Fa fs_type
156 is ``rw'' or ``ro'' then the file system whose name is given in the
157 .Fa fs_file
158 field is normally mounted read-write or read-only on the
159 specified special file.
160 If
161 .Fa fs_type
162 is ``sw'' then the special file is made available as a piece of swap
163 space by the
164 .Xr swapon 8
165 command at the end of the system reboot procedure.
166 The fields other than
167 .Fa fs_spec
168 and
169 .Fa fs_type
170 are unused.
171 If
172 .Fa fs_type
173 is specified as ``xx'' the entry is ignored.
174 This is useful to show disk partitions which are currently unused.
175 .Pp
176 The fifth field,
177 .Pq Fa fs_freq ,
178 is used for these file systems by the
179 .Xr dump 8
180 command to determine which file systems need to be dumped.
181 If the fifth field is not present, a value of zero is returned and
182 .Nm dump
183 will assume that the file system does not need to be dumped.
184 .Pp
185 The sixth field,
186 .Pq Fa fs_passno ,
187 is used by the
188 .Xr fsck 8
189 program to determine the order in which file system checks are done
190 at reboot time.
191 The root file system should be specified with a
192 .Fa fs_passno
193 of 1, and other file systems should have a
194 .Fa fs_passno
195 of 2.
196 File systems within a drive will be checked sequentially,
197 but file systems on different drives will be checked at the
198 same time to utilize parallelism available in the hardware.
199 If the sixth field is not present or is zero,
200 a value of zero is returned and
201 .Xr fsck 8
202 will assume that the file system does not need to be checked.
203 .Bd -literal
204 #define FSTAB_RW        "rw"    /* read/write device */
205 #define FSTAB_RQ        "rq"    /* read/write with quotas */
206 #define FSTAB_RO        "ro"    /* read-only device */
207 #define FSTAB_SW        "sw"    /* swap device */
208 #define FSTAB_XX        "xx"    /* ignore totally */
209
210 struct fstab {
211         char    *fs_spec;       /* block special device name */
212         char    *fs_file;       /* file system path prefix */
213         char    *fs_vfstype;    /* File system type, ufs, nfs */
214         char    *fs_mntops;     /* Mount options ala -o */
215         char    *fs_type;       /* FSTAB_* from fs_mntops */
216         int     fs_freq;        /* dump frequency, in days */
217         int     fs_passno;      /* pass number on parallel fsck */
218 };
219 .Ed
220 .Pp
221 The proper way to read records from
222 .Pa fstab
223 is to use the routines
224 .Xr getfsent 3 ,
225 .Xr getfsspec 3 ,
226 .Xr getfstype 3 ,
227 and
228 .Xr getfsfile 3 .
229 .Sh FILES
230 .Bl -tag -width /etc/fstab -compact
231 .It Pa /etc/fstab
232 The file
233 .Nm
234 resides in
235 .Pa /etc .
236 .El
237 .Sh SEE ALSO
238 .Xr getfsent 3 ,
239 .Xr getvfsbyname 3 ,
240 .Xr dump 8 ,
241 .Xr fsck 8 ,
242 .Xr mount 8 ,
243 .Xr quotacheck 8 ,
244 .Xr quotaon 8 ,
245 .Xr swapon 8 ,
246 .Xr umount 8
247 .Sh HISTORY
248 The
249 .Nm
250 file format appeared in
251 .Bx 4.0 .