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