xref: /freebsd/share/man/man5/fstab.5 (revision 67ea20ed3831ca50e8fe96a27f3d8d1776c16a56)
1afe61c15SRodney W. Grimes.\" Copyright (c) 1980, 1989, 1991, 1993
2afe61c15SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
3afe61c15SRodney W. Grimes.\"
4afe61c15SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
5afe61c15SRodney W. Grimes.\" modification, are permitted provided that the following conditions
6afe61c15SRodney W. Grimes.\" are met:
7afe61c15SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
8afe61c15SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
9afe61c15SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
10afe61c15SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
11afe61c15SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12afe61c15SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
13afe61c15SRodney W. Grimes.\"    must display the following acknowledgement:
14afe61c15SRodney W. Grimes.\"	This product includes software developed by the University of
15afe61c15SRodney W. Grimes.\"	California, Berkeley and its contributors.
16afe61c15SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
17afe61c15SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
18afe61c15SRodney W. Grimes.\"    without specific prior written permission.
19afe61c15SRodney W. Grimes.\"
20afe61c15SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21afe61c15SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22afe61c15SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23afe61c15SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24afe61c15SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25afe61c15SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26afe61c15SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27afe61c15SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28afe61c15SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29afe61c15SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30afe61c15SRodney W. Grimes.\" SUCH DAMAGE.
31afe61c15SRodney W. Grimes.\"
32afe61c15SRodney W. Grimes.\"     @(#)fstab.5	8.1 (Berkeley) 6/5/93
3367ea20edSGuy Helmer.\"	$Id: fstab.5,v 1.9 1998/06/28 21:33:42 hoek Exp $
34afe61c15SRodney W. Grimes.\"
35afe61c15SRodney W. Grimes.Dd June 5, 1993
36afe61c15SRodney W. Grimes.Dt FSTAB 5
37afe61c15SRodney W. Grimes.Os BSD 4
38afe61c15SRodney W. Grimes.Sh NAME
39afe61c15SRodney W. Grimes.Nm fstab
40afe61c15SRodney W. Grimes.Nd static information about the filesystems
41afe61c15SRodney W. Grimes.Sh SYNOPSIS
42afe61c15SRodney W. Grimes.Fd #include <fstab.h>
43afe61c15SRodney W. Grimes.Sh DESCRIPTION
44afe61c15SRodney W. GrimesThe file
45afe61c15SRodney W. Grimes.Nm fstab
46afe61c15SRodney W. Grimescontains descriptive information about the various file
47afe61c15SRodney W. Grimessystems.
48afe61c15SRodney W. Grimes.Nm fstab
49afe61c15SRodney W. Grimesis only read by programs, and not written;
50afe61c15SRodney W. Grimesit is the duty of the system administrator to properly create
51afe61c15SRodney W. Grimesand maintain this file.
52afe61c15SRodney W. GrimesEach filesystem is described on a separate line;
53afe61c15SRodney W. Grimesfields on each line are separated by tabs or spaces.
54afe61c15SRodney W. GrimesThe order of records in
55afe61c15SRodney W. Grimes.Nm fstab
56afe61c15SRodney W. Grimesis important because
57afe61c15SRodney W. Grimes.Xr fsck 8 ,
58afe61c15SRodney W. Grimes.Xr mount 8 ,
59afe61c15SRodney W. Grimesand
60afe61c15SRodney W. Grimes.Xr umount 8
61afe61c15SRodney W. Grimessequentially iterate through
62afe61c15SRodney W. Grimes.Nm fstab
63afe61c15SRodney W. Grimesdoing their thing.
64afe61c15SRodney W. Grimes.Pp
65afe61c15SRodney W. GrimesThe first field,
66afe61c15SRodney W. Grimes.Pq Fa fs_spec ,
67afe61c15SRodney W. Grimesdescribes the block special device or
68afe61c15SRodney W. Grimesremote filesystem to be mounted.
69afe61c15SRodney W. GrimesFor filesystems of type
70afe61c15SRodney W. Grimes.Em ufs ,
71afe61c15SRodney W. Grimesthe special file name is the block special file name,
72afe61c15SRodney W. Grimesand not the character special file name.
73afe61c15SRodney W. GrimesIf a program needs the character special file name,
74afe61c15SRodney W. Grimesthe program must create it by appending a ``r'' after the
75afe61c15SRodney W. Grimeslast ``/'' in the special file name.
76afe61c15SRodney W. Grimes.Pp
77afe61c15SRodney W. GrimesThe second field,
78afe61c15SRodney W. Grimes.Pq Fa fs_file ,
79afe61c15SRodney W. Grimesdescribes the mount point for the filesystem.
80afe61c15SRodney W. GrimesFor swap partitions, this field should be specified as ``none''.
81afe61c15SRodney W. Grimes.Pp
82afe61c15SRodney W. GrimesThe third field,
83afe61c15SRodney W. Grimes.Pq Fa fs_vfstype ,
84afe61c15SRodney W. Grimesdescribes the type of the filesystem.
85e9387c7dSWolfram SchneiderThe system can support various filesystem types.
86e9387c7dSWolfram SchneiderOnly the root, /usr, and /tmp filesystems need be statically
87e9387c7dSWolfram Schneidercompiled into the kernel;
88e9387c7dSWolfram Schneidereverything else will be automatically loaded at mount
89e9387c7dSWolfram Schneidertime.  (Exception: the UFS family - FFS, MFS, and LFS cannot
90e9387c7dSWolfram Schneidercurrently be demand-loaded.)  Some people still prefer to statically
91e9387c7dSWolfram Schneidercompile other filesystems as well.
92e9387c7dSWolfram Schneider
93afe61c15SRodney W. Grimes.Bl -tag -width indent -offset indent
94afe61c15SRodney W. Grimes.It Em ufs
95afe61c15SRodney W. Grimesa local
96afe61c15SRodney W. Grimes.Tn UNIX
97afe61c15SRodney W. Grimesfilesystem
98afe61c15SRodney W. Grimes.It Em mfs
99afe61c15SRodney W. Grimesa local memory-based
100afe61c15SRodney W. Grimes.Tn UNIX
101afe61c15SRodney W. Grimesfilesystem
102afe61c15SRodney W. Grimes.It Em nfs
103afe61c15SRodney W. Grimesa Sun Microsystems compatible ``Network File System''
104afe61c15SRodney W. Grimes.It Em swap
105afe61c15SRodney W. Grimesa disk partition to be used for swapping
1061c905436SAndrey A. Chernov.It Em msdos
107e9387c7dSWolfram Schneidera DOS compatible filesystem
108f657fac2SJordan K. Hubbard.It Em cd9660
109e9387c7dSWolfram Schneidera CD-ROM filesystem (as per ISO 9660)
110e9387c7dSWolfram Schneider.\" maybe also say Rock Ridge extensions are handled ?
111e9387c7dSWolfram Schneider.It Em procfs
112e9387c7dSWolfram Schneidera file system for accessing process data
113e9387c7dSWolfram Schneider.It Em kernfs
114e9387c7dSWolfram Schneidera file system for accessing kernel parameter
115afe61c15SRodney W. Grimes.El
116afe61c15SRodney W. Grimes.Pp
117afe61c15SRodney W. GrimesThe fourth field,
118afe61c15SRodney W. Grimes.Pq Fa fs_mntops ,
119afe61c15SRodney W. Grimesdescribes the mount options associated with the filesystem.
120afe61c15SRodney W. GrimesIt is formatted as a comma separated list of options.
121afe61c15SRodney W. GrimesIt contains at least the type of mount (see
122afe61c15SRodney W. Grimes.Fa fs_type
123afe61c15SRodney W. Grimesbelow) plus any additional options
12467ea20edSGuy Helmerappropriate to the filesystem type.  See the options flag
12567ea20edSGuy Helmer.Pq Fl o
12667ea20edSGuy Helmerin the
12767ea20edSGuy Helmer.Xr mount 8
12867ea20edSGuy Helmerpage and the filesystem specific page, such as
12967ea20edSGuy Helmer.Xr mount_nfs 8 ,
13067ea20edSGuy Helmerfor additional options that may be specified.
131afe61c15SRodney W. Grimes.Pp
132afe61c15SRodney W. GrimesIf the options ``userquota'' and/or ``groupquota'' are specified,
133afe61c15SRodney W. Grimesthe filesystem is automatically processed by the
134afe61c15SRodney W. Grimes.Xr quotacheck 8
135afe61c15SRodney W. Grimescommand, and user and/or group disk quotas are enabled with
136afe61c15SRodney W. Grimes.Xr quotaon 8 .
137afe61c15SRodney W. GrimesBy default,
138afe61c15SRodney W. Grimesfilesystem quotas are maintained in files named
139afe61c15SRodney W. Grimes.Pa quota.user
140afe61c15SRodney W. Grimesand
141afe61c15SRodney W. Grimes.Pa quota.group
142afe61c15SRodney W. Grimeswhich are located at the root of the associated filesystem.
143afe61c15SRodney W. GrimesThese defaults may be overridden by putting an equal sign
144afe61c15SRodney W. Grimesand an alternative absolute pathname following the quota option.
145afe61c15SRodney W. GrimesThus, if the user quota file for
146afe61c15SRodney W. Grimes.Pa /tmp
147afe61c15SRodney W. Grimesis stored in
148afe61c15SRodney W. Grimes.Pa /var/quotas/tmp.user ,
149afe61c15SRodney W. Grimesthis location can be specified as:
150afe61c15SRodney W. Grimes.Bd -literal -offset indent
151afe61c15SRodney W. Grimesuserquota=/var/quotas/tmp.user
152afe61c15SRodney W. Grimes.Ed
153afe61c15SRodney W. Grimes.Pp
154e70db05aSDavid GreenmanIf the option ``noauto'' is specified, the filesystem will not be automatically
155e70db05aSDavid Greenmanmounted at system startup.
156e70db05aSDavid Greenman.Pp
157afe61c15SRodney W. GrimesThe type of the mount is extracted from the
158afe61c15SRodney W. Grimes.Fa fs_mntops
159afe61c15SRodney W. Grimesfield and stored separately in the
160afe61c15SRodney W. Grimes.Fa fs_type
161afe61c15SRodney W. Grimesfield (it is not deleted from the
162afe61c15SRodney W. Grimes.Fa fs_mntops
163afe61c15SRodney W. Grimesfield).
164afe61c15SRodney W. GrimesIf
165afe61c15SRodney W. Grimes.Fa fs_type
166afe61c15SRodney W. Grimesis ``rw'' or ``ro'' then the filesystem whose name is given in the
167afe61c15SRodney W. Grimes.Fa fs_file
168afe61c15SRodney W. Grimesfield is normally mounted read-write or read-only on the
169afe61c15SRodney W. Grimesspecified special file.
170afe61c15SRodney W. GrimesIf
171afe61c15SRodney W. Grimes.Fa fs_type
172afe61c15SRodney W. Grimesis ``sw'' then the special file is made available as a piece of swap
173afe61c15SRodney W. Grimesspace by the
174afe61c15SRodney W. Grimes.Xr swapon 8
175afe61c15SRodney W. Grimescommand at the end of the system reboot procedure.
176afe61c15SRodney W. GrimesThe fields other than
177afe61c15SRodney W. Grimes.Fa fs_spec
178afe61c15SRodney W. Grimesand
179afe61c15SRodney W. Grimes.Fa fs_type
180afe61c15SRodney W. Grimesare unused.
181afe61c15SRodney W. GrimesIf
182afe61c15SRodney W. Grimes.Fa fs_type
183afe61c15SRodney W. Grimesis specified as ``xx'' the entry is ignored.
184afe61c15SRodney W. GrimesThis is useful to show disk partitions which are currently unused.
185afe61c15SRodney W. Grimes.Pp
186afe61c15SRodney W. GrimesThe fifth field,
187afe61c15SRodney W. Grimes.Pq Fa fs_freq ,
188afe61c15SRodney W. Grimesis used for these filesystems by the
189afe61c15SRodney W. Grimes.Xr dump 8
190afe61c15SRodney W. Grimescommand to determine which filesystems need to be dumped.
191afe61c15SRodney W. GrimesIf the fifth field is not present, a value of zero is returned and
192edf0e5b3SMike Pritchard.Nm dump
193afe61c15SRodney W. Grimeswill assume that the filesystem does not need to be dumped.
194afe61c15SRodney W. Grimes.Pp
195afe61c15SRodney W. GrimesThe sixth field,
196afe61c15SRodney W. Grimes.Pq Fa fs_passno ,
197afe61c15SRodney W. Grimesis used by the
198afe61c15SRodney W. Grimes.Xr fsck 8
199afe61c15SRodney W. Grimesprogram to determine the order in which filesystem checks are done
200afe61c15SRodney W. Grimesat reboot time.
201afe61c15SRodney W. GrimesThe root filesystem should be specified with a
202afe61c15SRodney W. Grimes.Fa fs_passno
203afe61c15SRodney W. Grimesof 1, and other filesystems should have a
204afe61c15SRodney W. Grimes.Fa fs_passno
205afe61c15SRodney W. Grimesof 2.
206afe61c15SRodney W. GrimesFilesystems within a drive will be checked sequentially,
207afe61c15SRodney W. Grimesbut filesystems on different drives will be checked at the
208afe61c15SRodney W. Grimessame time to utilize parallelism available in the hardware.
2094043c58eSTim VanderhoekIf the sixth field is not present or is zero,
210afe61c15SRodney W. Grimesa value of zero is returned and
211edf0e5b3SMike Pritchard.Xr fsck 8
212afe61c15SRodney W. Grimeswill assume that the filesystem does not need to be checked.
213afe61c15SRodney W. Grimes.Bd -literal
214ad2c737eSMike Pritchard#define	FSTAB_RW	"rw"	/* read/write device */
215ad2c737eSMike Pritchard#define	FSTAB_RQ	"rq"	/* read/write with quotas */
216afe61c15SRodney W. Grimes#define	FSTAB_RO	"ro"	/* read-only device */
217afe61c15SRodney W. Grimes#define	FSTAB_SW	"sw"	/* swap device */
218afe61c15SRodney W. Grimes#define	FSTAB_XX	"xx"	/* ignore totally */
219afe61c15SRodney W. Grimes
220afe61c15SRodney W. Grimesstruct fstab {
221afe61c15SRodney W. Grimes	char	*fs_spec;	/* block special device name */
222afe61c15SRodney W. Grimes	char	*fs_file;	/* filesystem path prefix */
223ad2c737eSMike Pritchard	char	*fs_vfstype;	/* File system type, ufs, nfs */
224ad2c737eSMike Pritchard	char	*fs_mntops;	/* Mount options ala -o */
225ad2c737eSMike Pritchard	char	*fs_type;	/* FSTAB_* from fs_mntops */
226afe61c15SRodney W. Grimes	int	fs_freq;	/* dump frequency, in days */
227ad2c737eSMike Pritchard	int	fs_passno;	/* pass number on parallel fsck */
228afe61c15SRodney W. Grimes};
229afe61c15SRodney W. Grimes.Ed
230afe61c15SRodney W. Grimes.Pp
231afe61c15SRodney W. GrimesThe proper way to read records from
232afe61c15SRodney W. Grimes.Pa fstab
233afe61c15SRodney W. Grimesis to use the routines
234afe61c15SRodney W. Grimes.Xr getfsent 3 ,
235afe61c15SRodney W. Grimes.Xr getfsspec 3 ,
236afe61c15SRodney W. Grimes.Xr getfstype 3 ,
237afe61c15SRodney W. Grimesand
238afe61c15SRodney W. Grimes.Xr getfsfile 3 .
239afe61c15SRodney W. Grimes.Sh FILES
240afe61c15SRodney W. Grimes.Bl -tag -width /etc/fstab -compact
241afe61c15SRodney W. Grimes.It Pa /etc/fstab
242afe61c15SRodney W. GrimesThe file
243afe61c15SRodney W. Grimes.Nm fstab
244afe61c15SRodney W. Grimesresides in
245afe61c15SRodney W. Grimes.Pa /etc .
246afe61c15SRodney W. Grimes.El
247afe61c15SRodney W. Grimes.Sh SEE ALSO
248e9387c7dSWolfram Schneider.Xr getfsent 3 ,
249e9387c7dSWolfram Schneider.Xr getvfsbyname 3 ,
250e9387c7dSWolfram Schneider.Xr dump 8 ,
251e9387c7dSWolfram Schneider.Xr fsck 8 ,
252e9387c7dSWolfram Schneider.Xr mount 8 ,
253e9387c7dSWolfram Schneider.Xr quotacheck 8 ,
254e9387c7dSWolfram Schneider.Xr quotaon 8 ,
255e9387c7dSWolfram Schneider.Xr swapon 8 ,
256e9387c7dSWolfram Schneider.Xr umount 8 .
257afe61c15SRodney W. Grimes.Sh HISTORY
258afe61c15SRodney W. GrimesThe
259afe61c15SRodney W. Grimes.Nm
260afe61c15SRodney W. Grimesfile format appeared in
261afe61c15SRodney W. Grimes.Bx 4.0 .
262