1 .\" Copyright (c) 1980, 1989, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)fstab.5 8.1 (Berkeley) 6/5/93
36 .Nd static information about the file systems
42 contains descriptive information about the various file
45 is only read by programs, and not written;
46 it is the duty of the system administrator to properly create
47 and maintain this file.
48 Each file system is described on a separate line;
49 fields on each line are separated by tabs or spaces.
50 The order of records in
57 sequentially iterate through
63 describes the special device or
64 remote file system to be mounted.
65 The contents are decoded by the
68 This allows using spaces or tabs in the device name which would be
69 interpreted as field separators otherwise.
73 describes the mount point for the file system.
74 For swap partitions, this field should be specified as
76 The contents are decoded by the
82 describes the type of the file system.
83 The system can support various file system types.
84 Only the root, /usr, and /tmp file systems need be statically
85 compiled into the kernel;
86 everything else will be automatically loaded at mount
88 (Exception: the FFS cannot currently be demand-loaded.)
89 Some people still prefer to statically
90 compile other file systems as well.
94 describes the mount options associated with the file system.
95 It is formatted as a comma separated list of options.
96 It contains at least the type of mount (see
98 below) plus any additional options appropriate to the file system type.
103 page and the file system specific page, such as
105 for additional options that may be specified.
106 All options that can be given to the file system specific mount commands
110 They just need to be formatted a bit differently.
113 option can be used without the preceding
116 Other options need both the file system specific flag and its argument,
117 separated by an equal sign.
118 For example, mounting an
120 filesystem, the options
121 .Bd -literal -offset indent
122 -o sync -o noatime -m 644 -M 755 -u foo -g bar
126 .Bd -literal -offset indent
127 sync,noatime,-m=644,-M=755,-u=foo,-g=bar
130 in the option field of
138 the file system is automatically processed by the
140 command, and user and/or group disk quotas are enabled with
143 file system quotas are maintained in files named
147 which are located at the root of the associated file system.
148 These defaults may be overridden by putting an equal sign
149 and an alternative absolute pathname following the quota option.
150 Thus, if the user quota file for
153 .Pa /var/quotas/tmp.user ,
154 this location can be specified as:
155 .Bd -literal -offset indent
156 userquota=/var/quotas/tmp.user
162 the system will ignore any error which happens during the mount of that filesystem,
163 which would otherwise cause the system to drop into single user mode.
164 This option is implemented by the
166 command and will not be passed to the kernel.
170 is specified, the file system will not be automatically
171 mounted at system startup.
172 Note that, for network file systems
174 (i.e., types supported by additional software
175 not included in the base system)
176 to be automatically mounted at system startup,
178 .Va extra_netfs_types
180 variable must be used to extend the
182 startup script's list of network file system types.
186 is specified, the file system will be automatically mounted
187 at a stage of system startup after remote mount points are mounted.
188 For more detail about this option,
193 The type of the mount is extracted from the
195 field and stored separately in the
197 field (it is not deleted from the
206 then the file system whose name is given in the
208 field is normally mounted read-write or read-only on the
209 specified special file.
215 then the special file is made available as a piece of swap
218 command at the end of the system reboot procedure.
219 For vnode-backed swap spaces,
229 .Pq Do md Dc or Do md[0-9]* Dc
236 device is created with the specified file used as backing store,
237 and then the new device is used as swap space.
240 devices will cause automatic creation of encrypted devices.
248 options may be passed to control those
251 The fields other than
260 the entry is ignored.
261 This is useful to show disk partitions which are currently unused.
265 is used for these file systems by the
267 command to determine which file systems need to be dumped.
268 If the fifth field is not present, a value of zero is returned and
270 will assume that the file system does not need to be dumped.
271 If the fifth field is greater than 0, then it specifies the number of days
272 between dumps for this file system.
280 programs to determine the order in which file system and quota
281 checks are done at reboot time.
284 field can be any value between 0 and
287 The root file system should be specified with a
289 of 1, and other file systems should have a
294 value of 1 is always checked sequentially and be completed before
295 another file system is processed, and it will be processed before
296 all file systems with a larger
299 For any given value of
301 file systems within a drive will be checked sequentially,
302 but file systems on different drives will be checked at the
303 same time to utilize parallelism available in the hardware.
304 Once all file system checks are complete for the current
306 the same process will start over for the next
309 If the sixth field is not present or is zero,
310 a value of zero is returned and
314 will assume that the file system does not need to be checked.
318 field can be used to implement finer control when
319 the system utilities may determine that the file system resides
320 on a different physical device, when it actually does not, as with a
323 All file systems with a lower
325 value will be completed before starting on file systems with a
329 E.g. all file systems with a
331 of 2 will be completed before any file systems with a
333 of 3 or greater are started.
334 Gaps are allowed between the different
337 E.g. file systems listed in
341 values such as 0, 1, 2, 15, 100, 200, 300, and may appear in any order
345 #define FSTAB_RW "rw" /* read/write device */
346 #define FSTAB_RQ "rq" /* read/write with quotas */
347 #define FSTAB_RO "ro" /* read-only device */
348 #define FSTAB_SW "sw" /* swap device */
349 #define FSTAB_XX "xx" /* ignore totally */
352 char *fs_spec; /* block special device name */
353 char *fs_file; /* file system path prefix */
354 char *fs_vfstype; /* File system type, ufs, nfs */
355 char *fs_mntops; /* Mount options ala -o */
356 char *fs_type; /* FSTAB_* from fs_mntops */
357 int fs_freq; /* dump frequency, in days */
358 int fs_passno; /* pass number on parallel fsck */
362 The proper way to read records from
364 is to use the routines
371 .Bl -tag -width /etc/fstab -compact
380 # Device Mountpoint FStype Options Dump Pass#
383 /dev/da0p2 / ufs rw 1 1
385 # Swap space on a block device.
386 /dev/da0p1 none swap sw 0 0
388 # Swap space using a block device with GBDE/GELI encyption.
389 # aalgo, ealgo, keylen, sectorsize options are available
391 /dev/da1p1.bde none swap sw 0 0
392 /dev/da1p2.eli none swap sw 0 0
395 tmpfs /tmp tmpfs rw,size=1g,mode=1777 0 0
397 # UFS file system on a swap-backed md(4). /dev/md10 is
398 # automatically created. If it is "md", a unit number
399 # will be automatically selected.
400 md10 /scratch mfs rw,-s1g 0 0
402 # Swap space on a vnode-backed md(4).
403 md11 none swap sw,file=/swapfile 0 0
405 # CDROM. "noauto" option is typically used because the
406 # media is removable.
407 /dev/cd0 /cdrom cd9660 ro,noauto 0 0
409 # NFS-exported file system. "serv" is an NFS server name
411 serv:/export /nfs nfs rw,noinet6 0 0
429 file format appeared in