]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/fstab.5.adoc
fstab: improve 4th field description
[thirdparty/util-linux.git] / sys-utils / fstab.5.adoc
CommitLineData
295b3979 1//po4a: entry man manual
6d5b6948
MB
2////
3Copyright (c) 1980, 1989, 1991 The Regents of the University of California.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions
8are met:
91. Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
112. Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
143. All advertising materials mentioning features or use of this software
15 must display the following acknowledgement:
16This product includes software developed by the University of
17California, Berkeley and its contributors.
184. Neither the name of the University nor the names of its contributors
19 may be used to endorse or promote products derived from this software
20 without specific prior written permission.
21
22THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32SUCH DAMAGE.
33
34 @(#)fstab.5 6.5 (Berkeley) 5/10/91
35////
36= fstab(5)
37:doctype: manpage
38:man manual: File formats
39:man source: util-linux {release-version}
40:page-layout: base
41:configfile: fstab
42
43== NAME
44
45fstab - static information about the filesystems
46
47== SYNOPSIS
48
49_/etc/fstab_
50
51== DESCRIPTION
52
360946bb 53The file *fstab* contains descriptive information about the filesystems the system can mount. *fstab* is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file. The order of records in *fstab* is important because *fsck*(8), *mount*(8), and *umount*(8) sequentially iterate through *fstab* doing their thing.
6d5b6948
MB
54
55Each filesystem is described on a separate line. Fields on each line are separated by tabs or spaces. Lines starting with '#' are comments. Blank lines are ignored.
56
57The following is a typical example of an *fstab* entry:
58
59....
60LABEL=t-home2 /home ext4 defaults,auto_da_alloc 0 2
61....
62
63=== The first field (_fs_spec_).
64
43a6b183 65This field describes the block special device, remote filesystem or filesystem image for loop device to be mounted or swap file or swap device to be enabled.
6d5b6948
MB
66
67For ordinary mounts, it will hold (a link to) a block special device node (as created by *mknod*(2)) for the device to be mounted, like _/dev/cdrom_ or _/dev/sdb7_. For NFS mounts, this field is _<host>:<dir>_, e.g., _knuth.aeb.nl:/_. For filesystems with no storage, any string can be used, and will show up in *df*(1) output, for example. Typical usage is _proc_ for *procfs*; _mem_, _none_, or _tmpfs_ for *tmpfs*. Other special filesystems, like *udev* and *sysfs*, are typically not listed in *fstab*.
68
544e64e0 69LABEL=<label> or UUID=<uuid> may be given instead of a device name. This is the recommended method, as device names are often a coincidence of hardware detection order, and can change when other disks are added or removed. For example, 'LABEL=Boot' or 'UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'. (Use a filesystem-specific tool like *e2label*(8), *xfs_admin*(8), or *fatlabel*(8) to set LABELs on filesystems).
6d5b6948
MB
70
71It's also possible to use *PARTUUID=* and *PARTLABEL=*. These partitions identifiers are supported for example for GUID Partition Table (GPT).
72
73See *mount*(8), *blkid*(8) or *lsblk*(8) for more details about device identifiers.
74
75Note that *mount*(8) uses UUIDs as strings. The string representation of the UUID should be based on lower case characters. But when specifying the volume ID of FAT or NTFS file systems upper case characters are used (e.g UUID="A40D-85E7" or UUID="61DB7756DB7779B3").
6d5b6948
MB
76
77=== The second field (_fs_file_).
78
43a6b183 79This field describes the mount point (target) for the filesystem. For swap area, this field should be specified as `none'. If the name of the mount point contains spaces or tabs these can be escaped as `\040' and '\011' respectively.
6d5b6948
MB
80
81=== The third field (_fs_vfstype_).
82
360946bb 83This field describes the type of the filesystem. Linux supports many filesystem types: ext4, xfs, btrfs, f2fs, vfat, ntfs, hfsplus, tmpfs, sysfs, proc, iso9660, udf, squashfs, nfs, cifs, and many more. For more details, see *mount*(8).
6d5b6948
MB
84
85An entry _swap_ denotes a file or partition to be used for swapping, cf. *swapon*(8). An entry _none_ is useful for bind or move mounts.
86
87More than one type may be specified in a comma-separated list.
88
89*mount*(8) and *umount*(8) support filesystem _subtypes_. The subtype is defined by '.subtype' suffix. For example 'fuse.sshfs'. It's recommended to use subtype notation rather than add any prefix to the first fstab field (for example 'sshfs#example.com' is deprecated).
6d5b6948
MB
90
91=== The fourth field (_fs_mntops_).
92
6d5b6948
MB
93This field describes the mount options associated with the filesystem.
94
43a6b183
KZ
95It is formatted as a comma-separated list of options and is optional for mount(8) or swapon(8). The usual convention is to use at least "defaults" keyword there.
96
97It usually contains the type of mount (*ro* or *rw*, the default is *rw*), plus any additional options appropriate to the filesystem type (including performance-tuning options). For details, see *mount*(8) or *swapon*(8).
6d5b6948
MB
98
99Basic filesystem-independent options are:
100
101*defaults*::
43a6b183 102use default options. The default depends on the kernel and the filesystem. mount(8) does not have any hardcoded set of default options. The kernel default is usually rw, suid, dev, exec, auto, nouser, and async.
6d5b6948 103*noauto*::
68860732 104do not mount when *mount -a* is given (e.g., at boot time)
6d5b6948 105*user*::
68860732 106allow a user to mount
6d5b6948 107*owner*::
68860732 108allow device owner to mount
6d5b6948 109*comment*::
68860732 110or *x-<name>* for use by fstab-maintaining programs
6d5b6948 111*nofail*::
68860732 112do not report errors for this device if it does not exist.
6d5b6948
MB
113
114=== The fifth field (_fs_freq_).
115
6d5b6948 116This field is used by *dump*(8) to determine which filesystems need to be dumped. Defaults to zero (don't dump) if not present.
6d5b6948
MB
117
118=== The sixth field (_fs_passno_).
119
6d5b6948 120This field is used by *fsck*(8) to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a _fs_passno_ of 1. Other filesystems should have a _fs_passno_ of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. Defaults to zero (don't check the filesystem) if not present.
6d5b6948
MB
121
122== FILES
123
68860732 124_/etc/fstab_,
6d5b6948
MB
125_<fstab.h>_
126
127== NOTES
128
129The proper way to read records from *fstab* is to use the routines *getmntent*(3) or *libmount*.
130
131The keyword *ignore* as a filesystem type (3rd field) is no longer supported by the pure libmount based mount utility (since util-linux v2.22).
132
133== HISTORY
134
135The ancestor of this *fstab* file format appeared in 4.0BSD.
136
137== SEE ALSO
138
139*getmntent*(3),
140*fs*(5),
141*findmnt*(8),
142*mount*(8),
143*swapon*(8)
144
625e9c61 145include::man-common/bugreports.adoc[]
6d5b6948 146
625e9c61 147include::man-common/footer-config.adoc[]
6d5b6948
MB
148
149ifdef::translation[]
625e9c61 150include::man-common/translation.adoc[]
6d5b6948 151endif::[]