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