]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/fstab.5
Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
[thirdparty/util-linux.git] / sys-utils / fstab.5
CommitLineData
6dbe3af9
KZ
1.\" Copyright (c) 1980, 1989, 1991 The Regents of the University of California.
2.\" 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 6.5 (Berkeley) 5/10/91
33.\"
14160b7b 34.TH FSTAB 5 "February 2015" "util-linux" "File Formats"
6dbe3af9
KZ
35.SH NAME
36fstab \- static information about the filesystems
37.SH SYNOPSIS
46f057ed 38.I /etc/fstab
6dbe3af9
KZ
39.SH DESCRIPTION
40The file
b9f23bf7 41.B fstab
14160b7b 42contains descriptive information about the filesystems the system can mount.
6dbe3af9
KZ
43.B fstab
44is only read by programs, and not written; it is the duty of the system
14160b7b 45administrator to properly create and maintain this file. The order of records in
6dbe3af9
KZ
46.B fstab
47is important because
2b6fc908
KZ
48.BR fsck (8),
49.BR mount (8),
3bd8d70c 50and
2b6fc908 51.BR umount (8)
6dbe3af9
KZ
52sequentially iterate through
53.B fstab
54doing their thing.
55
14160b7b
PC
56Each filesystem is described on a separate line.
57Fields on each line are separated by tabs or spaces.
58Lines starting with '#' are comments. Blank lines are ignored.
59.PP
60The following is a typical example of an
61.B fstab
62entry:
63.sp
64.RS 7
65LABEL=t-home2 /home ext4 defaults,auto_da_alloc 0 2
66.RE
67
abe3d704
KZ
68.B The first field
69.RI ( fs_spec ).
70.RS
f52eed86
KZ
71This field describes the block special device, remote filesystem or filesystem
72image for loop device to be mounted or swap file or swap partition to be enabled.
7eda085c 73.LP
14160b7b 74For ordinary mounts, it will hold (a link to) a block special
7eda085c 75device node (as created by
dbeb1d73 76.BR mknod (2))
7eda085c 77for the device to be mounted, like `/dev/cdrom' or `/dev/sdb7'.
14160b7b
PC
78For NFS mounts, this field is <host>:<dir>, e.g., `knuth.aeb.nl:/'.
79For filesystems with no storage, any string can be used, and will show up in
80.BR df (1)
81output, for example. Typical usage is `proc' for procfs; `mem', `none',
82or `tmpfs' for tmpfs. Other special filesystems, like udev and sysfs,
83are typically not listed in
84.BR fstab .
7eda085c 85.LP
14160b7b
PC
86LABEL=<label> or UUID=<uuid> may be given instead of a device name.
87This is the recommended method, as device names are often a coincidence
88of hardware detection order, and can change when other disks are added or removed.
89For example, `LABEL=Boot' or `UUID=3e6be9de\%-8139\%-11d1\%-9106\%-a43f08d823a6'.
90(Use a filesystem-specific tool like
91.BR e2label (8),
92.BR xfs_admin (8),
c07ebfa1 93or
14160b7b
PC
94.BR fatlabel (8)
95to set LABELs on filesystems).
3e90c89f
KZ
96
97It's also possible to use PARTUUID= and PARTLABEL=. These partitions identifiers
71e87708 98are supported for example for GUID Partition Table (GPT).
3e90c89f
KZ
99
100See
71e87708 101.BR mount (8),
3e90c89f
KZ
102.BR blkid (8)
103or
104.BR lsblk (8)
14160b7b 105for more details about device identifiers.
3e90c89f 106
7c97f740
KZ
107.LP
108Note that
109.BR mount (8)
110uses UUIDs as strings. The string representation of the UUID should be based on
111lower case characters.
abe3d704 112.RE
6dbe3af9 113
abe3d704
KZ
114.B The second field
115.RI ( fs_file ).
116.RS
c768892f 117This field describes the mount point (target) for the filesystem. For swap partitions, this
7eda085c 118field should be specified as `none'. If the name of the mount point
6db1b1b1
AH
119contains spaces or tabs these can be escaped as `\\040' and '\\011'
120respectively.
abe3d704 121.RE
6dbe3af9 122
abe3d704
KZ
123.B The third field
124.RI ( fs_vfstype ).
125.RS
14160b7b
PC
126This field describes the type of the filesystem. Linux supports many
127filesystem types: ext4, xfs, btrfs, f2fs, vfat, ntfs, hfsplus,
128tmpfs, sysfs, proc, iso9660, udf, squashfs, nfs, cifs, and many more.
129For more details, see
ffc43748 130.BR mount (8).
abe3d704 131
ffc43748
KZ
132An entry
133.I swap
134denotes a file or partition to be used
135for swapping, cf.\&
136.BR swapon (8).
137An entry
f92dc20f
KZ
138.I none
139is useful for bind or move mounts.
6dbe3af9 140
e9b6e76a
KZ
141More than one type may be specified in a comma-separated list.
142
e31597d8
KZ
143.BR mount (8)
144and
145.BR umount (8)
abe3d704
KZ
146support filesystem
147.IR subtypes .
148The subtype is defined by '.subtype' suffix. For
e31597d8
KZ
149example 'fuse.sshfs'. It's recommended to use subtype notation rather than add
150any prefix to the first fstab field (for example 'sshfs#example.com' is
208848ef 151deprecated).
abe3d704 152.RE
e31597d8 153
abe3d704
KZ
154.B The fourth field
155.RI ( fs_mntops ).
156.RS
157This field describes the mount options associated with the filesystem.
6dbe3af9 158
14160b7b
PC
159It is formatted as a comma-separated list of options.
160It contains at least the type of mount
161.RB ( ro
162or
163.BR rw ),
164plus any additional options appropriate to the filesystem
165type (including performance-tuning options).
166For details, see
167.BR mount (8)
168or
37f243ed
KZ
169.BR swapon (8).
170
14160b7b 171Basic filesystem-independent options are:
abe3d704
KZ
172.TP
173.B defaults
174use default options: rw, suid, dev, exec, auto, nouser, and async.
175.TP
176.B noauto
1c4c6024 177do not mount when "mount \-a" is given (e.g., at boot time)
abe3d704
KZ
178.TP
179.B user
180allow a user to mount
181.TP
182.B owner
183allow device owner to mount
184.TP
185.B comment
12b41eac
KZ
186or
187.B x-<name>
abe3d704
KZ
188for use by fstab-maintaining programs
189.TP
190.B nofail
191do not report errors for this device if it does not exist.
192.RE
6dbe3af9 193
abe3d704
KZ
194.B The fifth field
195.RI ( fs_freq ).
196.RS
14160b7b 197This field is used by
6dbe3af9 198.BR dump (8)
14160b7b
PC
199to determine which filesystems need to be dumped.
200Defaults to zero (don't dump) if not present.
abe3d704 201.RE
6dbe3af9 202
abe3d704
KZ
203.B The sixth field
204.RI ( fs_passno ).
205.RS
14160b7b 206This field is used by
6dbe3af9 207.BR fsck (8)
14160b7b
PC
208to determine the order in which filesystem checks are done at
209boot time. The root filesystem should be specified with a
6dbe3af9 210.I fs_passno
14160b7b 211of 1. Other filesystems should have a
6dbe3af9
KZ
212.I fs_passno
213of 2. Filesystems within a drive will be checked sequentially, but
214filesystems on different drives will be checked at the same time to utilize
14160b7b
PC
215parallelism available in the hardware.
216Defaults to zero (don't fsck) if not present.
85efb656 217.RE
6dbe3af9 218
67e63c12
MK
219.SH FILES
220.IR /etc/fstab ,
221.I <fstab.h>
222
12b41eac 223.SH NOTES
6dbe3af9
KZ
224The proper way to read records from
225.B fstab
226is to use the routines
ca618233
KZ
227.BR getmntent (3)
228or
229.BR libmount .
12b41eac
KZ
230
231The keyword
232.B ignore
14160b7b 233as a filesystem type (3rd field) is no longer supported by the pure
12b41eac 234libmount based mount utility (since util-linux v2.22).
ade04bb8
MK
235.SH HISTORY
236The ancestor of this
237.B fstab
238file format appeared in 4.0BSD.
239.\" But without comment convention, and options and vfs_type.
5a829806 240.SH SEE ALSO
f053ff1e
MK
241.BR getmntent (3),
242.BR fs (5),
12b41eac 243.BR findmnt (8),
eb63b9b8 244.BR mount (8),
f053ff1e 245.BR swapon (8)
ffc43748 246.\" Instead there was a type rw/ro/rq/sw/xx, where xx is the present 'ignore'.
86d62711 247.SH AVAILABILITY
601d12fb 248This man page is part of the util-linux package and is available from
d673b74e 249https://www.kernel.org/pub/linux/utils/util-linux/.