1 .\" $OpenBSD: fstab.5,v 1.45 2011/04/17 20:17:12 krw Exp $
2 .\" $NetBSD: fstab.5,v 1.5.2.1 1995/11/16 20:11:11 pk Exp $
4 .\" Copyright (c) 1980, 1989, 1991, 1993
5 .\" The Regents of the University of California. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the University nor the names of its contributors
16 .\" may be used to endorse or promote products derived from this software
17 .\" without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" @(#)fstab.5 8.1 (Berkeley) 6/5/93
33 .Dd $Mdocdate: April 17 2011 $
38 .Nd static information about the filesystems
40 .Fd #include <fstab.h>
44 file contains descriptive information about the various file systems.
46 is only read by programs, and not written;
47 it is the duty of the system administrator to properly create
48 and maintain this file.
49 Each filesystem is described on a separate line;
50 fields on each line are separated by tabs or spaces.
51 Lines beginning with the
53 character are comments and are ignored.
54 The order of records in
60 sequentially iterate through
64 A line has the following format:
65 .Bd -literal -offset indent
66 fs_spec fs_file fs_vfstype fs_mntops fs_freq fs_passno
71 describes the block special device or remote filesystem to be mounted.
72 A block special device may be specified by pathname
76 For filesystems of type MFS
77 the special file name is typically that of the primary swap area;
80 is used instead of a special file name,
81 default configuration parameters are used.
82 If a program needs the character special file name,
83 the program must create it by appending an
87 in the special file name.
91 describes the mount point for the filesystem.
92 For swap partitions, this field should be specified as
97 describes the type of the filesystem.
98 The system currently supports the following types of filesystems:
100 .Bl -tag -width indent -offset indent -compact
102 An ISO 9660 CD-ROM filesystem.
104 A local Linux compatible ext2fs
119 A Sun Microsystems compatible Network File System.
123 A local filesystem containing process information.
125 A disk partition to be used for swapping.
131 A local, efficient memory-based file system.
136 describes the mount options associated with the filesystem.
137 It is formatted as a comma separated list of options.
138 It contains at least the type of mount (see
140 below) plus any additional options appropriate to the filesystem type.
147 a file system not to be mounted automatically (with
151 or at system boot time).
157 are specified, the filesystem is automatically processed by the
159 command, and user and/or group disk quotas are enabled with
161 By default, filesystem quotas are maintained in files named
165 which are located at the root of the associated filesystem.
166 These defaults may be overridden by putting an equal sign
167 and an alternative absolute pathname following the quota option.
168 Thus, if the user quota file for
171 .Pa /var/quotas/tmp.user ,
172 this location can be specified as:
173 .Bd -literal -offset indent
174 userquota=/var/quotas/tmp.user
177 The type of the mount is extracted from the first parameter of the
179 field and stored separately in the
181 field (it is not deleted from the
191 then the filesystem whose name is given in the
193 field is normally mounted read-write or read-only on the
194 specified special file.
199 then the special file is made available as a piece of swap space by the
201 command at the end of the system reboot procedure.
202 The fields other than
211 the entry is ignored.
212 This is useful to show disk partitions which are currently unused.
222 to recommend which filesystems should be backed up.
223 The value specifies the number of days
224 after which a dump is regarded as being old;
225 if it is not present, a value of zero is returned and
227 will assume that the filesystem does not need to be dumped.
233 program to determine the order in which filesystem checks are done
235 The root filesystem should be specified with a
237 of 1, and other filesystems should have a
240 Filesystems within a drive will be checked sequentially,
241 but filesystems on different drives will be checked at the
242 same time to utilize parallelism available in the hardware.
243 If the sixth field is not present or is zero,
244 a value of zero is returned and
246 will assume that the filesystem does not need to be checked.
248 #define FSTAB_RW "rw" /* read/write device */
249 #define FSTAB_RQ "rq" /* read/write with quotas *
250 #define FSTAB_RO "ro" /* read-only device */
251 #define FSTAB_SW "sw" /* swap device */
252 #define FSTAB_XX "xx" /* ignore totally */
255 char *fs_spec; /* block special device name */
256 char *fs_file; /* filesystem path prefix */
257 char *fs_vfstype; /* type of filesystem */
258 char *fs_mntops; /* comma separated mount options */
259 char *fs_type; /* rw, rq, ro, sw, or xx */
260 int fs_freq; /* dump frequency, in days */
261 int fs_passno; /* pass number on parallel fsck */
265 The proper way to read records from
267 is to use the routines
273 .Bl -tag -width /etc/fstab -compact
280 .Bd -literal -offset indent
281 /dev/sd0b none swap sw
282 /dev/sd1b none swap sw
283 /dev/sd0a / ffs rw 1 1
284 /dev/sd0e /var ffs rw,nodev,nosuid 1 2
285 #/dev/sd0f /tmp ffs rw,nodev,nosuid 1 2
286 swap /tmp mfs rw,nodev,nosuid,-s=153600 0 0
287 /dev/sd0g /usr ffs rw,nodev 1 2
288 /dev/sd0h /usr/local ffs rw,nodev 1 2
289 /dev/sd0i /home ffs rw,nodev,nosuid 1 2
290 /dev/sd0j /usr/src ffs rw,nodev,nosuid,softdep 1 2
291 /dev/cd0a /cdrom cd9660 ro,noauto 0 0
292 5b27c2761a9b0b06.i /mnt/key msdos rw,noauto 0 0
293 server:/export/ports /usr/ports nfs rw,nodev,nosuid,soft,intr 0 0
305 file format appeared in