xref: /freebsd/share/man/man5/fstab.5 (revision 1a720cbec513210fa2e85c3882741ef2f6dc5f35)
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.
12dda5b397SEitan Adler.\" 3. Neither the name of the University nor the names of its contributors
13afe61c15SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
14afe61c15SRodney W. Grimes.\"    without specific prior written permission.
15afe61c15SRodney W. Grimes.\"
16afe61c15SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17afe61c15SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18afe61c15SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19afe61c15SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20afe61c15SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21afe61c15SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22afe61c15SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23afe61c15SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24afe61c15SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25afe61c15SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26afe61c15SRodney W. Grimes.\" SUCH DAMAGE.
27afe61c15SRodney W. Grimes.\"
28cd2fccbbSChristian Brueffer.Dd April 14, 2014
29afe61c15SRodney W. Grimes.Dt FSTAB 5
303d45e180SRuslan Ermilov.Os
31afe61c15SRodney W. Grimes.Sh NAME
32afe61c15SRodney W. Grimes.Nm fstab
33afe61c15SRodney W. Grimes.Nd static information about the file systems
34afe61c15SRodney W. Grimes.Sh SYNOPSIS
3532eef9aeSRuslan Ermilov.In fstab.h
36afe61c15SRodney W. Grimes.Sh DESCRIPTION
37afe61c15SRodney W. GrimesThe file
384b66483fSRuslan Ermilov.Nm
39afe61c15SRodney W. Grimescontains descriptive information about the various file
40afe61c15SRodney W. Grimessystems.
414b66483fSRuslan Ermilov.Nm
42afe61c15SRodney W. Grimesis only read by programs, and not written;
43afe61c15SRodney W. Grimesit is the duty of the system administrator to properly create
44afe61c15SRodney W. Grimesand maintain this file.
45afe61c15SRodney W. GrimesEach file system is described on a separate line;
46afe61c15SRodney W. Grimesfields on each line are separated by tabs or spaces.
47afe61c15SRodney W. GrimesThe order of records in
484b66483fSRuslan Ermilov.Nm
49afe61c15SRodney W. Grimesis important because
50afe61c15SRodney W. Grimes.Xr fsck 8 ,
51afe61c15SRodney W. Grimes.Xr mount 8 ,
52afe61c15SRodney W. Grimesand
53afe61c15SRodney W. Grimes.Xr umount 8
54afe61c15SRodney W. Grimessequentially iterate through
554b66483fSRuslan Ermilov.Nm
56afe61c15SRodney W. Grimesdoing their thing.
57afe61c15SRodney W. Grimes.Pp
58afe61c15SRodney W. GrimesThe first field,
59afe61c15SRodney W. Grimes.Pq Fa fs_spec ,
60f2c05021SMike Pritcharddescribes the special device or
61afe61c15SRodney W. Grimesremote file system to be mounted.
62da087883SStefan FarfelederThe contents are decoded by the
63da087883SStefan Farfeleder.Xr strunvis 3
64da087883SStefan Farfelederfunction.
65da087883SStefan FarfelederThis allows using spaces or tabs in the device name which would be
66da087883SStefan Farfelederinterpreted as field separators otherwise.
67afe61c15SRodney W. Grimes.Pp
68afe61c15SRodney W. GrimesThe second field,
69afe61c15SRodney W. Grimes.Pq Fa fs_file ,
70afe61c15SRodney W. Grimesdescribes the mount point for the file system.
71df6a289eSXin LIFor swap partitions, this field should be specified as
72df6a289eSXin LI.Dq none .
73da087883SStefan FarfelederThe contents are decoded by the
74da087883SStefan Farfeleder.Xr strunvis 3
75da087883SStefan Farfelederfunction, as above.
76afe61c15SRodney W. Grimes.Pp
77afe61c15SRodney W. GrimesThe third field,
78afe61c15SRodney W. Grimes.Pq Fa fs_vfstype ,
79afe61c15SRodney W. Grimesdescribes the type of the file system.
80e9387c7dSWolfram SchneiderThe system can support various file system types.
81e9387c7dSWolfram SchneiderOnly the root, /usr, and /tmp file systems need be statically
82e9387c7dSWolfram Schneidercompiled into the kernel;
83e9387c7dSWolfram Schneidereverything else will be automatically loaded at mount
845203edcdSRuslan Ermilovtime.
8575184335SWarner Losh(Exception: the FFS cannot currently be demand-loaded.)
865203edcdSRuslan ErmilovSome people still prefer to statically
87e9387c7dSWolfram Schneidercompile other file systems as well.
88afe61c15SRodney W. Grimes.Pp
89afe61c15SRodney W. GrimesThe fourth field,
90afe61c15SRodney W. Grimes.Pq Fa fs_mntops ,
91afe61c15SRodney W. Grimesdescribes the mount options associated with the file system.
92afe61c15SRodney W. GrimesIt is formatted as a comma separated list of options.
93afe61c15SRodney W. GrimesIt contains at least the type of mount (see
94afe61c15SRodney W. Grimes.Fa fs_type
956e63b508SGiorgos Keramidasbelow) plus any additional options appropriate to the file system type.
965203edcdSRuslan ErmilovSee the options flag
9767ea20edSGuy Helmer.Pq Fl o
9867ea20edSGuy Helmerin the
9967ea20edSGuy Helmer.Xr mount 8
10067ea20edSGuy Helmerpage and the file system specific page, such as
10167ea20edSGuy Helmer.Xr mount_nfs 8 ,
10267ea20edSGuy Helmerfor additional options that may be specified.
1036e63b508SGiorgos KeramidasAll options that can be given to the file system specific mount commands
1046e63b508SGiorgos Keramidascan be used in
1056e63b508SGiorgos Keramidas.Nm
1066e63b508SGiorgos Keramidasas well.
1076e63b508SGiorgos KeramidasThey just need to be formatted a bit differently.
1086e63b508SGiorgos KeramidasThe arguments of the
1096e63b508SGiorgos Keramidas.Fl o
1106e63b508SGiorgos Keramidasoption can be used without the preceding
1116e63b508SGiorgos Keramidas.Fl o
1126e63b508SGiorgos Keramidasflag.
1136e63b508SGiorgos KeramidasOther options need both the file system specific flag and its argument,
1146e63b508SGiorgos Keramidasseparated by an equal sign.
1156e63b508SGiorgos KeramidasFor example, mounting an
116*1a720cbeSAlexander Ziaee.Xr msdosfs 4
1176e63b508SGiorgos Keramidasfilesystem, the options
1186e63b508SGiorgos Keramidas.Bd -literal -offset indent
1196e63b508SGiorgos Keramidas-o sync -o noatime -m 644 -M 755 -u foo -g bar
1206e63b508SGiorgos Keramidas.Ed
1216e63b508SGiorgos Keramidas.Pp
1226e63b508SGiorgos Keramidasshould be written as
1236e63b508SGiorgos Keramidas.Bd -literal -offset indent
1246e63b508SGiorgos Keramidassync,noatime,-m=644,-M=755,-u=foo,-g=bar
1256e63b508SGiorgos Keramidas.Ed
1266e63b508SGiorgos Keramidas.Pp
1276e63b508SGiorgos Keramidasin the option field of
1286e63b508SGiorgos Keramidas.Nm .
129afe61c15SRodney W. Grimes.Pp
130df6a289eSXin LIIf the options
131df6a289eSXin LI.Dq userquota
132df6a289eSXin LIand/or
133df6a289eSXin LI.Dq groupquota
134df6a289eSXin LIare specified,
135afe61c15SRodney W. Grimesthe file system is automatically processed by the
136afe61c15SRodney W. Grimes.Xr quotacheck 8
137afe61c15SRodney W. Grimescommand, and user and/or group disk quotas are enabled with
138afe61c15SRodney W. Grimes.Xr quotaon 8 .
139afe61c15SRodney W. GrimesBy default,
140afe61c15SRodney W. Grimesfile system quotas are maintained in files named
141afe61c15SRodney W. Grimes.Pa quota.user
142afe61c15SRodney W. Grimesand
143afe61c15SRodney W. Grimes.Pa quota.group
144afe61c15SRodney W. Grimeswhich are located at the root of the associated file system.
145afe61c15SRodney W. GrimesThese defaults may be overridden by putting an equal sign
146afe61c15SRodney W. Grimesand an alternative absolute pathname following the quota option.
147afe61c15SRodney W. GrimesThus, if the user quota file for
148afe61c15SRodney W. Grimes.Pa /tmp
149afe61c15SRodney W. Grimesis stored in
150afe61c15SRodney W. Grimes.Pa /var/quotas/tmp.user ,
151afe61c15SRodney W. Grimesthis location can be specified as:
152afe61c15SRodney W. Grimes.Bd -literal -offset indent
153afe61c15SRodney W. Grimesuserquota=/var/quotas/tmp.user
154afe61c15SRodney W. Grimes.Ed
155afe61c15SRodney W. Grimes.Pp
156df6a289eSXin LIIf the option
157df6a289eSXin LI.Dq failok
158df6a289eSXin LIis specified,
159c7383075SXin LIthe system will ignore any error which happens during the mount of that filesystem,
160c7383075SXin LIwhich would otherwise cause the system to drop into single user mode.
161c7383075SXin LIThis option is implemented by the
162c7383075SXin LI.Xr mount 8
163c7383075SXin LIcommand and will not be passed to the kernel.
164c7383075SXin LI.Pp
165df6a289eSXin LIIf the option
166df6a289eSXin LI.Dq noauto
167df6a289eSXin LIis specified, the file system will not be automatically
168e70db05aSDavid Greenmanmounted at system startup.
1691c2941b2SSheldon HearnNote that, for network file systems
1701c2941b2SSheldon Hearnof third party types
1715203edcdSRuslan Ermilov(i.e., types supported by additional software
1721c2941b2SSheldon Hearnnot included in the base system)
1731c2941b2SSheldon Hearnto be automatically mounted at system startup,
1741c2941b2SSheldon Hearnthe
17563122b7fSRuslan Ermilov.Va extra_netfs_types
1761c2941b2SSheldon Hearn.Xr rc.conf 5
1771c2941b2SSheldon Hearnvariable must be used to extend the
178bb522200SSheldon Hearn.Xr rc 8
1791c2941b2SSheldon Hearnstartup script's list of network file system types.
180e70db05aSDavid Greenman.Pp
181268a55bcSHiroki SatoIf the option
182268a55bcSHiroki Sato.Dq late
183268a55bcSHiroki Satois specified, the file system will be automatically mounted
184268a55bcSHiroki Satoat a stage of system startup after remote mount points are mounted.
185268a55bcSHiroki SatoFor more detail about this option,
186268a55bcSHiroki Satosee the
187268a55bcSHiroki Sato.Xr mount 8
188268a55bcSHiroki Satomanual page.
189268a55bcSHiroki Sato.Pp
190634add3cSMaxim SobolevIf the option
191634add3cSMaxim Sobolev.Dq update
192634add3cSMaxim Sobolevis specified, it indicates that the status of an already mounted file
193634add3cSMaxim Sobolevsystem should be changed accordingly.
194634add3cSMaxim SobolevThis allows, for example, file systems mounted read-only to be upgraded
195634add3cSMaxim Sobolevread-write and vice-versa.
196634add3cSMaxim SobolevBy default, an entry corresponding to a file systems that is already
197634add3cSMaxim Sobolevmounted is going to be skipped over when processing
198634add3cSMaxim Sobolev.Nm ,
199634add3cSMaxim Sobolevunless it's a root file system, in which case logic similar to
200634add3cSMaxim Sobolev.Dq update
201634add3cSMaxim Sobolevis applied automatically.
202634add3cSMaxim Sobolev.Pp
203634add3cSMaxim SobolevThe
204634add3cSMaxim Sobolev.Dq update
2055be4c726SGordon Berglingoption is typically used in conjunction with two
206634add3cSMaxim Sobolev.Nm
207634add3cSMaxim Sobolevfiles.
208634add3cSMaxim SobolevThe first
209634add3cSMaxim Sobolev.Nm
210634add3cSMaxim Sobolevfile is used to set up the initial set of file systems.
211634add3cSMaxim SobolevThe second
212634add3cSMaxim Sobolev.Nm
213634add3cSMaxim Sobolevfile is then run to update the initial set of file systems and
214634add3cSMaxim Sobolevto add additional file systems.
215634add3cSMaxim Sobolev.Pp
216afe61c15SRodney W. GrimesThe type of the mount is extracted from the
217afe61c15SRodney W. Grimes.Fa fs_mntops
218afe61c15SRodney W. Grimesfield and stored separately in the
219afe61c15SRodney W. Grimes.Fa fs_type
220afe61c15SRodney W. Grimesfield (it is not deleted from the
221afe61c15SRodney W. Grimes.Fa fs_mntops
222afe61c15SRodney W. Grimesfield).
223afe61c15SRodney W. GrimesIf
224afe61c15SRodney W. Grimes.Fa fs_type
225df6a289eSXin LIis
226df6a289eSXin LI.Dq rw
227df6a289eSXin LIor
228df6a289eSXin LI.Dq ro
229df6a289eSXin LIthen the file system whose name is given in the
230afe61c15SRodney W. Grimes.Fa fs_file
231afe61c15SRodney W. Grimesfield is normally mounted read-write or read-only on the
232afe61c15SRodney W. Grimesspecified special file.
233268a55bcSHiroki Sato.Pp
234afe61c15SRodney W. GrimesIf
235afe61c15SRodney W. Grimes.Fa fs_type
236df6a289eSXin LIis
237df6a289eSXin LI.Dq sw
238df6a289eSXin LIthen the special file is made available as a piece of swap
239afe61c15SRodney W. Grimesspace by the
240afe61c15SRodney W. Grimes.Xr swapon 8
241afe61c15SRodney W. Grimescommand at the end of the system reboot procedure.
242a616b253SDoug MooreFor swap devices, the keyword
243a616b253SDoug Moore.Dq trimonce
244a616b253SDoug Mooretriggers the delivery of a
245a616b253SDoug Moore.Dv BIO_DELETE
246504f5e29SDoug Moorecommand to the device.
247504f5e29SDoug MooreThis command marks the device's blocks as unused, except those that
248504f5e29SDoug Mooremight store a disk label.
249504f5e29SDoug MooreThis marking can erase a crash dump.
250504f5e29SDoug MooreTo delay
251504f5e29SDoug Moore.Nm swapon
252504f5e29SDoug Moorefor a device until after
253504f5e29SDoug Moore.Nm savecore
254504f5e29SDoug Moorehas copied the crash dump to another location, use the
255504f5e29SDoug Moore.Dq late
256504f5e29SDoug Mooreoption.
257268a55bcSHiroki SatoFor vnode-backed swap spaces,
258268a55bcSHiroki Sato.Dq file
259268a55bcSHiroki Satois supported in the
260268a55bcSHiroki Sato.Fa fs_mntops
261268a55bcSHiroki Satofield.
262268a55bcSHiroki SatoWhen
263268a55bcSHiroki Sato.Fa fs_spec
264268a55bcSHiroki Satois an
265268a55bcSHiroki Sato.Xr md 4
266268a55bcSHiroki Satodevice file
267268a55bcSHiroki Sato.Pq Do md Dc or Do md[0-9]* Dc
268268a55bcSHiroki Satoand
269268a55bcSHiroki Sato.Dq file
270268a55bcSHiroki Satois specified in
271268a55bcSHiroki Sato.Fa fs_mntopts ,
272268a55bcSHiroki Satoan
273268a55bcSHiroki Sato.Xr md 4
274268a55bcSHiroki Satodevice is created with the specified file used as backing store,
275268a55bcSHiroki Satoand then the new device is used as swap space.
276a78deafaSHiroki SatoSwap entries on
277a78deafaSHiroki Sato.Pa .eli
278a78deafaSHiroki Satodevices will cause automatic creation of encrypted devices.
279a78deafaSHiroki SatoThe
280a78deafaSHiroki Sato.Dq ealgo ,
281a78deafaSHiroki Sato.Dq aalgo ,
282cd2fccbbSChristian Brueffer.Dq keylen ,
283445bda3fSPawel Jakub Dawidek.Dq notrim ,
284a78deafaSHiroki Satoand
285a78deafaSHiroki Sato.Dq sectorsize
286a78deafaSHiroki Satooptions may be passed to control those
287a78deafaSHiroki Sato.Xr geli 8
288a78deafaSHiroki Satoparameters.
289afe61c15SRodney W. GrimesThe fields other than
290afe61c15SRodney W. Grimes.Fa fs_spec
291afe61c15SRodney W. Grimesand
292afe61c15SRodney W. Grimes.Fa fs_type
293afe61c15SRodney W. Grimesare unused.
294afe61c15SRodney W. GrimesIf
295afe61c15SRodney W. Grimes.Fa fs_type
296df6a289eSXin LIis specified as
297df6a289eSXin LI.Dq xx
298df6a289eSXin LIthe entry is ignored.
299afe61c15SRodney W. GrimesThis is useful to show disk partitions which are currently unused.
300afe61c15SRodney W. Grimes.Pp
301afe61c15SRodney W. GrimesThe fifth field,
302afe61c15SRodney W. Grimes.Pq Fa fs_freq ,
303afe61c15SRodney W. Grimesis used for these file systems by the
304afe61c15SRodney W. Grimes.Xr dump 8
305afe61c15SRodney W. Grimescommand to determine which file systems need to be dumped.
306afe61c15SRodney W. GrimesIf the fifth field is not present, a value of zero is returned and
307edf0e5b3SMike Pritchard.Nm dump
308afe61c15SRodney W. Grimeswill assume that the file system does not need to be dumped.
309e3fbf603SWarner LoshIf the fifth field is greater than 0, then it specifies the number of days
310e3fbf603SWarner Loshbetween dumps for this file system.
311afe61c15SRodney W. Grimes.Pp
312afe61c15SRodney W. GrimesThe sixth field,
313afe61c15SRodney W. Grimes.Pq Fa fs_passno ,
314afe61c15SRodney W. Grimesis used by the
315afe61c15SRodney W. Grimes.Xr fsck 8
316c980e8b5SMike Pritchardand
317c980e8b5SMike Pritchard.Xr quotacheck 8
3185338828aSMike Pritchardprograms to determine the order in which file system and quota
3195338828aSMike Pritchardchecks are done at reboot time.
3205338828aSMike PritchardThe
3215338828aSMike Pritchard.Fa fs_passno
3225338828aSMike Pritchardfield can be any value between 0 and
3235338828aSMike Pritchard.Ql INT_MAX Ns -1 .
3245338828aSMike Pritchard.Pp
325afe61c15SRodney W. GrimesThe root file system should be specified with a
326afe61c15SRodney W. Grimes.Fa fs_passno
327afe61c15SRodney W. Grimesof 1, and other file systems should have a
328afe61c15SRodney W. Grimes.Fa fs_passno
3295338828aSMike Pritchardof 2 or greater.
3305338828aSMike PritchardA file system with a
3315338828aSMike Pritchard.Fa fs_passno
3325338828aSMike Pritchardvalue of 1 is always checked sequentially and be completed before
3335338828aSMike Pritchardanother file system is processed, and it will be processed before
3345338828aSMike Pritchardall file systems with a larger
3355338828aSMike Pritchard.Fa fs_passno .
3365338828aSMike Pritchard.Pp
337203f7a28SMike PritchardFor any given value of
338203f7a28SMike Pritchard.Fa fs_passno ,
339203f7a28SMike Pritchardfile systems within a drive will be checked sequentially,
340afe61c15SRodney W. Grimesbut file systems on different drives will be checked at the
341afe61c15SRodney W. Grimessame time to utilize parallelism available in the hardware.
342203f7a28SMike PritchardOnce all file system checks are complete for the current
343203f7a28SMike Pritchard.Fa fs_passno ,
344203f7a28SMike Pritchardthe same process will start over for the next
345203f7a28SMike Pritchard.Fa fs_passno .
346203f7a28SMike Pritchard.Pp
3474043c58eSTim VanderhoekIf the sixth field is not present or is zero,
348afe61c15SRodney W. Grimesa value of zero is returned and
349edf0e5b3SMike Pritchard.Xr fsck 8
350c980e8b5SMike Pritchardand
351c980e8b5SMike Pritchard.Xr quotacheck 8
352afe61c15SRodney W. Grimeswill assume that the file system does not need to be checked.
3535338828aSMike Pritchard.Pp
3545338828aSMike PritchardThe
3555338828aSMike Pritchard.Fa fs_passno
3565338828aSMike Pritchardfield can be used to implement finer control when
3575338828aSMike Pritchardthe system utilities may determine that the file system resides
3585338828aSMike Pritchardon a different physical device, when it actually does not, as with a
3595338828aSMike Pritchard.Xr ccd 4
3605338828aSMike Pritcharddevice.
361203f7a28SMike PritchardAll file systems with a lower
362203f7a28SMike Pritchard.Fa fs_passno
363203f7a28SMike Pritchardvalue will be completed before starting on file systems with a
364203f7a28SMike Pritchardhigher
365203f7a28SMike Pritchard.Fa fs_passno
366203f7a28SMike Pritchardvalue.
367203f7a28SMike PritchardE.g. all file systems with a
368203f7a28SMike Pritchard.Fa fs_passno
369203f7a28SMike Pritchardof 2 will be completed before any file systems with a
370203f7a28SMike Pritchard.Fa fs_passno
371203f7a28SMike Pritchardof 3 or greater are started.
372203f7a28SMike PritchardGaps are allowed between the different
373203f7a28SMike Pritchard.Fa fs_passno
374203f7a28SMike Pritchardvalues.
375203f7a28SMike PritchardE.g. file systems listed in
376203f7a28SMike Pritchard.Pa /etc/fstab
377203f7a28SMike Pritchardmay have
378203f7a28SMike Pritchard.Fa fs_passno
379203f7a28SMike Pritchardvalues such as 0, 1, 2, 15, 100, 200, 300, and may appear in any order
380203f7a28SMike Pritchardwithin
381203f7a28SMike Pritchard.Pa /etc/fstab .
382afe61c15SRodney W. Grimes.Bd -literal
383ad2c737eSMike Pritchard#define	FSTAB_RW	"rw"	/* read/write device */
384ad2c737eSMike Pritchard#define	FSTAB_RQ	"rq"	/* read/write with quotas */
385afe61c15SRodney W. Grimes#define	FSTAB_RO	"ro"	/* read-only device */
386afe61c15SRodney W. Grimes#define	FSTAB_SW	"sw"	/* swap device */
387afe61c15SRodney W. Grimes#define	FSTAB_XX	"xx"	/* ignore totally */
388afe61c15SRodney W. Grimes
389afe61c15SRodney W. Grimesstruct fstab {
390afe61c15SRodney W. Grimes	char	*fs_spec;	/* block special device name */
391afe61c15SRodney W. Grimes	char	*fs_file;	/* file system path prefix */
392ad2c737eSMike Pritchard	char	*fs_vfstype;	/* File system type, ufs, nfs */
393ad2c737eSMike Pritchard	char	*fs_mntops;	/* Mount options ala -o */
394ad2c737eSMike Pritchard	char	*fs_type;	/* FSTAB_* from fs_mntops */
395afe61c15SRodney W. Grimes	int	fs_freq;	/* dump frequency, in days */
396ad2c737eSMike Pritchard	int	fs_passno;	/* pass number on parallel fsck */
397afe61c15SRodney W. Grimes};
398afe61c15SRodney W. Grimes.Ed
399afe61c15SRodney W. Grimes.Pp
400afe61c15SRodney W. GrimesThe proper way to read records from
401afe61c15SRodney W. Grimes.Pa fstab
402afe61c15SRodney W. Grimesis to use the routines
403afe61c15SRodney W. Grimes.Xr getfsent 3 ,
404afe61c15SRodney W. Grimes.Xr getfsspec 3 ,
405afe61c15SRodney W. Grimes.Xr getfstype 3 ,
406afe61c15SRodney W. Grimesand
407afe61c15SRodney W. Grimes.Xr getfsfile 3 .
408afe61c15SRodney W. Grimes.Sh FILES
409afe61c15SRodney W. Grimes.Bl -tag -width /etc/fstab -compact
410afe61c15SRodney W. Grimes.It Pa /etc/fstab
411afe61c15SRodney W. GrimesThe file
4124b66483fSRuslan Ermilov.Nm
413afe61c15SRodney W. Grimesresides in
414afe61c15SRodney W. Grimes.Pa /etc .
415afe61c15SRodney W. Grimes.El
4169d52c5eaSHiroki Sato.Sh EXAMPLES
4179d52c5eaSHiroki Sato.Bd -literal
4189d52c5eaSHiroki Sato# Device	Mountpoint	FStype	Options		Dump	Pass#
4199d52c5eaSHiroki Sato#
4209d52c5eaSHiroki Sato# UFS file system.
4219d52c5eaSHiroki Sato/dev/da0p2	/		ufs	rw		1	1
4229d52c5eaSHiroki Sato#
4239d52c5eaSHiroki Sato# Swap space on a block device.
4249d52c5eaSHiroki Sato/dev/da0p1	none		swap	sw		0	0
4259d52c5eaSHiroki Sato#
42614b475c4SPoul-Henning Kamp# Swap space using a block device with GELI encryption.
4279d52c5eaSHiroki Sato# aalgo, ealgo, keylen, sectorsize options are available
4289d52c5eaSHiroki Sato# for .eli devices.
4299d52c5eaSHiroki Sato/dev/da1p2.eli	none		swap	sw		0	0
4309d52c5eaSHiroki Sato#
4319d52c5eaSHiroki Sato# tmpfs.
4329d52c5eaSHiroki Satotmpfs		/tmp		tmpfs	rw,size=1g,mode=1777	0 0
4339d52c5eaSHiroki Sato#
4349d52c5eaSHiroki Sato# UFS file system on a swap-backed md(4).  /dev/md10 is
4359d52c5eaSHiroki Sato# automatically created.  If it is "md", a unit number
4369d52c5eaSHiroki Sato# will be automatically selected.
4379d52c5eaSHiroki Satomd10		/scratch	mfs	rw,-s1g		0	0
4389d52c5eaSHiroki Sato#
4399d52c5eaSHiroki Sato# Swap space on a vnode-backed md(4).
4409d52c5eaSHiroki Satomd11		none		swap	sw,file=/swapfile	0 0
4419d52c5eaSHiroki Sato#
4429d52c5eaSHiroki Sato# CDROM.  "noauto" option is typically used because the
4439d52c5eaSHiroki Sato# media is removable.
4449d52c5eaSHiroki Sato/dev/cd0	/cdrom		cd9660	ro,noauto	0	0
4459d52c5eaSHiroki Sato#
4469d52c5eaSHiroki Sato# NFS-exported file system.  "serv" is an NFS server name
4479d52c5eaSHiroki Sato# or IP address.
4489d52c5eaSHiroki Satoserv:/export	/nfs		nfs	rw,noinet6	0	0
4499d52c5eaSHiroki Sato.Ed
450afe61c15SRodney W. Grimes.Sh SEE ALSO
451e9387c7dSWolfram Schneider.Xr getfsent 3 ,
452e9387c7dSWolfram Schneider.Xr getvfsbyname 3 ,
45379ce8a64SJoel Dahl.Xr strunvis 3 ,
4545338828aSMike Pritchard.Xr ccd 4 ,
455e9387c7dSWolfram Schneider.Xr dump 8 ,
456e9387c7dSWolfram Schneider.Xr fsck 8 ,
457a78deafaSHiroki Sato.Xr geli 8 ,
458e9387c7dSWolfram Schneider.Xr mount 8 ,
459e9387c7dSWolfram Schneider.Xr quotacheck 8 ,
460e9387c7dSWolfram Schneider.Xr quotaon 8 ,
461e9387c7dSWolfram Schneider.Xr swapon 8 ,
4626fe89339SBen Smithurst.Xr umount 8
463afe61c15SRodney W. Grimes.Sh HISTORY
464afe61c15SRodney W. GrimesThe
465afe61c15SRodney W. Grimes.Nm
466afe61c15SRodney W. Grimesfile format appeared in
467afe61c15SRodney W. Grimes.Bx 4.0 .
468