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
33 .Nd static information about the file systems
39 contains descriptive information about the various file
42 is only read by programs, and not written;
43 it is the duty of the system administrator to properly create
44 and maintain this file.
45 Each file system is described on a separate line;
46 fields on each line are separated by tabs or spaces.
47 The order of records in
54 sequentially iterate through
60 describes the special device or
61 remote file system to be mounted.
62 The contents are decoded by the
65 This allows using spaces or tabs in the device name which would be
66 interpreted as field separators otherwise.
70 describes the mount point for the file system.
71 For swap partitions, this field should be specified as
73 The contents are decoded by the
79 describes the type of the file system.
80 The system can support various file system types.
81 Only the root, /usr, and /tmp file systems need be statically
82 compiled into the kernel;
83 everything else will be automatically loaded at mount
85 (Exception: the FFS cannot currently be demand-loaded.)
86 Some people still prefer to statically
87 compile other file systems as well.
91 describes the mount options associated with the file system.
92 It is formatted as a comma separated list of options.
93 It contains at least the type of mount (see
95 below) plus any additional options appropriate to the file system type.
100 page and the file system specific page, such as
102 for additional options that may be specified.
103 All options that can be given to the file system specific mount commands
107 They just need to be formatted a bit differently.
110 option can be used without the preceding
113 Other options need both the file system specific flag and its argument,
114 separated by an equal sign.
115 For example, mounting an
117 filesystem, the options
118 .Bd -literal -offset indent
119 -o sync -o noatime -m 644 -M 755 -u foo -g bar
123 .Bd -literal -offset indent
124 sync,noatime,-m=644,-M=755,-u=foo,-g=bar
127 in the option field of
135 the file system is automatically processed by the
137 command, and user and/or group disk quotas are enabled with
140 file system quotas are maintained in files named
144 which are located at the root of the associated file system.
145 These defaults may be overridden by putting an equal sign
146 and an alternative absolute pathname following the quota option.
147 Thus, if the user quota file for
150 .Pa /var/quotas/tmp.user ,
151 this location can be specified as:
152 .Bd -literal -offset indent
153 userquota=/var/quotas/tmp.user
159 the system will ignore any error which happens during the mount of that filesystem,
160 which would otherwise cause the system to drop into single user mode.
161 This option is implemented by the
163 command and will not be passed to the kernel.
167 is specified, the file system will not be automatically
168 mounted at system startup.
169 Note that, for network file systems
171 (i.e., types supported by additional software
172 not included in the base system)
173 to be automatically mounted at system startup,
175 .Va extra_netfs_types
177 variable must be used to extend the
179 startup script's list of network file system types.
183 is specified, the file system will be automatically mounted
184 at a stage of system startup after remote mount points are mounted.
185 For more detail about this option,
192 is specified, it indicates that the status of an already mounted file
193 system should be changed accordingly.
194 This allows, for example, file systems mounted read-only to be upgraded
195 read-write and vice-versa.
196 By default, an entry corresponding to a file systems that is already
197 mounted is going to be skipped over when processing
199 unless it's a root file system, in which case logic similar to
201 is applied automatically.
205 option is typically used in conjunction with two
210 file is used to set up the initial set of file systems.
213 file is then run to update the initial set of file systems and
214 to add additional file systems.
216 The type of the mount is extracted from the
218 field and stored separately in the
220 field (it is not deleted from the
229 then the file system whose name is given in the
231 field is normally mounted read-write or read-only on the
232 specified special file.
238 then the special file is made available as a piece of swap
241 command at the end of the system reboot procedure.
242 For swap devices, the keyword
244 triggers the delivery of a
246 command to the device.
247 This command marks the device's blocks as unused, except those that
248 might store a disk label.
249 This marking can erase a crash dump.
252 for a device until after
254 has copied the crash dump to another location, use the
257 For vnode-backed swap spaces,
267 .Pq Do md Dc or Do md[0-9]* Dc
274 device is created with the specified file used as backing store,
275 and then the new device is used as swap space.
278 devices will cause automatic creation of encrypted devices.
286 options may be passed to control those
289 The fields other than
298 the entry is ignored.
299 This is useful to show disk partitions which are currently unused.
303 is used for these file systems by the
305 command to determine which file systems need to be dumped.
306 If the fifth field is not present, a value of zero is returned and
308 will assume that the file system does not need to be dumped.
309 If the fifth field is greater than 0, then it specifies the number of days
310 between dumps for this file system.
318 programs to determine the order in which file system and quota
319 checks are done at reboot time.
322 field can be any value between 0 and
325 The root file system should be specified with a
327 of 1, and other file systems should have a
332 value of 1 is always checked sequentially and be completed before
333 another file system is processed, and it will be processed before
334 all file systems with a larger
337 For any given value of
339 file systems within a drive will be checked sequentially,
340 but file systems on different drives will be checked at the
341 same time to utilize parallelism available in the hardware.
342 Once all file system checks are complete for the current
344 the same process will start over for the next
347 If the sixth field is not present or is zero,
348 a value of zero is returned and
352 will assume that the file system does not need to be checked.
356 field can be used to implement finer control when
357 the system utilities may determine that the file system resides
358 on a different physical device, when it actually does not, as with a
361 All file systems with a lower
363 value will be completed before starting on file systems with a
367 E.g. all file systems with a
369 of 2 will be completed before any file systems with a
371 of 3 or greater are started.
372 Gaps are allowed between the different
375 E.g. file systems listed in
379 values such as 0, 1, 2, 15, 100, 200, 300, and may appear in any order
383 #define FSTAB_RW "rw" /* read/write device */
384 #define FSTAB_RQ "rq" /* read/write with quotas */
385 #define FSTAB_RO "ro" /* read-only device */
386 #define FSTAB_SW "sw" /* swap device */
387 #define FSTAB_XX "xx" /* ignore totally */
390 char *fs_spec; /* block special device name */
391 char *fs_file; /* file system path prefix */
392 char *fs_vfstype; /* File system type, ufs, nfs */
393 char *fs_mntops; /* Mount options ala -o */
394 char *fs_type; /* FSTAB_* from fs_mntops */
395 int fs_freq; /* dump frequency, in days */
396 int fs_passno; /* pass number on parallel fsck */
400 The proper way to read records from
402 is to use the routines
409 .Bl -tag -width /etc/fstab -compact
418 # Device Mountpoint FStype Options Dump Pass#
421 /dev/da0p2 / ufs rw 1 1
423 # Swap space on a block device.
424 /dev/da0p1 none swap sw 0 0
426 # Swap space using a block device with GBDE/GELI encryption.
427 # aalgo, ealgo, keylen, sectorsize options are available
429 /dev/da1p1.bde none swap sw 0 0
430 /dev/da1p2.eli none swap sw 0 0
433 tmpfs /tmp tmpfs rw,size=1g,mode=1777 0 0
435 # UFS file system on a swap-backed md(4). /dev/md10 is
436 # automatically created. If it is "md", a unit number
437 # will be automatically selected.
438 md10 /scratch mfs rw,-s1g 0 0
440 # Swap space on a vnode-backed md(4).
441 md11 none swap sw,file=/swapfile 0 0
443 # CDROM. "noauto" option is typically used because the
444 # media is removable.
445 /dev/cd0 /cdrom cd9660 ro,noauto 0 0
447 # NFS-exported file system. "serv" is an NFS server name
449 serv:/export /nfs nfs rw,noinet6 0 0
467 file format appeared in