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. 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. 15.\" 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 26.\" SUCH DAMAGE. 27.\" 28.\" @(#)fstab.5 8.1 (Berkeley) 6/5/93 29.\" $FreeBSD: src/share/man/man5/fstab.5,v 1.11.2.8 2003/02/10 12:21:08 des Exp $ 30.\" 31.Dd September 13, 2009 32.Dt FSTAB 5 33.Os 34.Sh NAME 35.Nm fstab 36.Nd static information about the file systems 37.Sh SYNOPSIS 38.In fstab.h 39.Sh DESCRIPTION 40The file 41.Nm 42contains descriptive information about the various file 43systems. 44.Nm 45is only read by programs, and not written; 46it is the duty of the system administrator to properly create 47and maintain this file. 48Each file system is described on a separate line; 49fields on each line are separated by tabs or spaces. 50The order of records in 51.Nm 52is important because 53.Xr fsck 8 , 54.Xr mount 8 , 55and 56.Xr umount 8 57sequentially iterate through 58.Nm 59doing their thing. 60.Pp 61The first field, 62.Pq Fa fs_spec , 63describes the special file or 64remote file system to be mounted. 65This may be a 66.Pa /dev/<path> , 67a label from a 68.Xr devtab 5 69(typically 70.Pa /etc/devtab ) , 71or a 72.Pa <host>:<path> 73for NFS. 74Note that 75.Xr devtab 5 76labels maybe augmented with a 77.Pa .suffix 78trailer. 79For example 80.Pa mydisk.s1a . 81Also note 82.Pa /dev 83based paths can mount serial numbers similar to 84.Xr devtab 5 85labels by using the path 86.Pa /dev/serno/SERIALNO[.suffix] . 87.Pp 88The second field, 89.Pq Fa fs_file , 90describes the mount point for the file system. 91For swap partitions, this field should be specified as 92.Dq none . 93.Pp 94The third field, 95.Pq Fa fs_vfstype , 96describes the type of the file system. 97The system can support various file system types. 98Only the root, 99.Pa /usr , 100and 101.Pa /tmp 102file systems need be statically 103compiled into the kernel; 104everything else will be automatically loaded at mount 105time. 106(Exception: the UFS family - FFS, MFS, and LFS cannot 107currently be demand-loaded.) Some people still prefer to statically 108compile other file systems as well. 109.Pp 110The most common file system types are: 111.Bl -tag -width indent -offset indent 112.It Em HAMMER 113a local 114.Xr HAMMER 5 115file system 116.It Em ufs 117a local 118.Xr ffs 5 119.Ux 120file system 121.It Em mfs 122a local memory-based 123.Ux 124file system 125.It Em nfs 126a Sun Microsystems compatible 127.Dq "Network File System" 128.It Em swap 129a disk partition to be used for swapping 130.It Em msdos 131a local 132.Xr msdos 5 133DOS compatible file system 134.It Em cd9660 135a local CD-ROM file system (as per ISO 9660) 136.\" maybe also say Rock Ridge extensions are handled ? 137.It Em procfs 138a file system for accessing process data 139.El 140.Pp 141The fourth field, 142.Pq Fa fs_mntops , 143describes the mount options associated with the file system. 144It is formatted as a comma separated list of options. 145It contains at least the type of mount (see 146.Fa fs_type 147below) plus any additional options 148appropriate to the file system type. 149See the options flag 150.Pq Fl o 151in the 152.Xr mount 8 153page and the file system specific page, such as 154.Xr mount_nfs 8 , 155for additional options that may be specified. 156.Pp 157If the options ``userquota'' and/or ``groupquota'' are specified, 158the file system is automatically processed by the 159.Xr quotacheck 8 160command, and user and/or group disk quotas are enabled with 161.Xr quotaon 8 . 162By default, 163file system quotas are maintained in files named 164.Pa quota.user 165and 166.Pa quota.group 167which are located at the root of the associated file system. 168These defaults may be overridden by putting an equal sign 169and an alternative absolute pathname following the quota option. 170Thus, if the user quota file for 171.Pa /tmp 172is stored in 173.Pa /var/quotas/tmp.user , 174this location can be specified as: 175.Bd -literal -offset indent 176userquota=/var/quotas/tmp.user 177.Ed 178.Pp 179If the option ``noauto'' is specified, the file system will not be automatically 180mounted at system startup. 181This is recommended for all remote file systems other than NFS, 182since only NFS mounts are delayed until after network initialization 183by the 184.Xr rc 8 185startup scripts. 186.Pp 187Swap partitions may specify the option ``crypt'' to automatically encrypt 188the swap partition with a random key. Note that you will not be able to 189recover any kernel core dumps if you use this option. 190.Pp 191The type of the mount is extracted from the 192.Fa fs_mntops 193field and stored separately in the 194.Fa fs_type 195field (it is not deleted from the 196.Fa fs_mntops 197field). 198If 199.Fa fs_type 200is ``rw'' or ``ro'' then the file system whose name is given in the 201.Fa fs_file 202field is normally mounted read-write or read-only on the 203specified special file. 204If 205.Fa fs_type 206is ``sw'' then the special file is made available as a piece of swap 207space by the 208.Xr swapon 8 209command at the end of the system reboot procedure. 210The fields other than 211.Fa fs_spec 212and 213.Fa fs_type 214are unused. 215If 216.Fa fs_type 217is specified as ``xx'' the entry is ignored. 218This is useful to show disk partitions which are currently unused. 219.Pp 220The fifth field, 221.Pq Fa fs_freq , 222is used for these file systems by the 223.Xr dump 8 224command to determine which file systems need to be dumped. 225If the fifth field is not present, a value of zero is returned and 226.Nm dump 227will assume that the file system does not need to be dumped. 228.Pp 229The sixth field, 230.Pq Fa fs_passno , 231is used by the 232.Xr fsck 8 233program to determine the order in which file system checks are done 234at reboot time. 235The root file system should be specified with a 236.Fa fs_passno 237of 1, and other file systems should have a 238.Fa fs_passno 239of 2. 240File systems within a drive will be checked sequentially, 241but file systems on different drives will be checked at the 242same time to utilize parallelism available in the hardware. 243If the sixth field is not present or is zero, 244a value of zero is returned and 245.Xr fsck 8 246will assume that the file system does not need to be checked. 247.Bd -literal 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 */ 253 254struct fstab { 255 char *fs_spec; /* block special device name */ 256 char *fs_file; /* file system path prefix */ 257 char *fs_vfstype; /* File system type, ufs, nfs */ 258 char *fs_mntops; /* Mount options ala -o */ 259 char *fs_type; /* FSTAB_* from fs_mntops */ 260 int fs_freq; /* dump frequency, in days */ 261 int fs_passno; /* pass number on parallel fsck */ 262}; 263.Ed 264.Pp 265The proper way to read records from 266.Nm 267is to use the routines 268.Xr getfsent 3 , 269.Xr getfsspec 3 , 270.Xr getfstype 3 , 271and 272.Xr getfsfile 3 . 273.Sh FILES 274.Bl -tag -width /etc/fstab -compact 275.It Pa /etc/fstab 276The file 277.Nm 278resides in 279.Pa /etc . 280.El 281.Sh SEE ALSO 282.Xr getfsent 3 , 283.Xr getvfsbyname 3 , 284.Xr HAMMER 5 , 285.Xr dump 8 , 286.Xr fsck 8 , 287.Xr mount 8 , 288.Xr quotacheck 8 , 289.Xr quotaon 8 , 290.Xr swapon 8 , 291.Xr umount 8 292.Sh HISTORY 293The 294.Nm 295file format appeared in 296.Bx 4.0 . 297