1FSTAB(5)                         File formats                         FSTAB(5)
2
3
4

NAME

6       fstab - static information about the filesystems
7

SYNOPSIS

9       /etc/fstab
10

DESCRIPTION

12       The file fstab contains descriptive information about the filesystems
13       the system can mount. fstab is only read by programs, and not written;
14       it is the duty of the system administrator to properly create and
15       maintain this file. The order of records in fstab is important because
16       fsck(8), mount(8), and umount(8) sequentially iterate through fstab
17       doing their thing.
18
19       Each filesystem is described on a separate line. Fields on each line
20       are separated by tabs or spaces. Lines starting with '#' are comments.
21       Blank lines are ignored.
22
23       The following is a typical example of an fstab entry:
24
25           LABEL=t-home2   /home      ext4    defaults,auto_da_alloc      0  2
26
27   The first field (fs_spec).
28       This field describes the block special device, remote filesystem or
29       filesystem image for loop device to be mounted or swap file or swap
30       device to be enabled.
31
32       For ordinary mounts, it will hold (a link to) a block special device
33       node (as created by mknod(2)) for the device to be mounted, like
34       /dev/cdrom or /dev/sdb7. For NFS mounts, this field is <host>:<dir>,
35       e.g., knuth.aeb.nl:/. For filesystems with no storage, any string can
36       be used, and will show up in df(1) output, for example. Typical usage
37       is proc for procfs; mem, none, or tmpfs for tmpfs. Other special
38       filesystems, like udev and sysfs, are typically not listed in fstab.
39
40       LABEL=<label> or UUID=<uuid> may be given instead of a device name.
41       This is the recommended method, as device names are often a coincidence
42       of hardware detection order, and can change when other disks are added
43       or removed. For example, 'LABEL=Boot' or
44       'UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'. (Use a filesystem-specific
45       tool like e2label(8), xfs_admin(8), or fatlabel(8) to set LABELs on
46       filesystems).
47
48       It’s also possible to use PARTUUID= and PARTLABEL=. These partitions
49       identifiers are supported for example for GUID Partition Table (GPT).
50
51       See mount(8), blkid(8) or lsblk(8) for more details about device
52       identifiers.
53
54       Note that mount(8) uses UUIDs as strings. The string representation of
55       the UUID should be based on lower case characters. But when specifying
56       the volume ID of FAT or NTFS file systems upper case characters are
57       used (e.g UUID="A40D-85E7" or UUID="61DB7756DB7779B3").
58
59   The second field (fs_file).
60       This field describes the mount point (target) for the filesystem. For
61       swap area, this field should be specified as `none'. If the name of the
62       mount point contains spaces or tabs these can be escaped as `\040' and
63       '\011' respectively.
64
65   The third field (fs_vfstype).
66       This field describes the type of the filesystem. Linux supports many
67       filesystem types: ext4, xfs, btrfs, f2fs, vfat, ntfs, hfsplus, tmpfs,
68       sysfs, proc, iso9660, udf, squashfs, nfs, cifs, and many more. For more
69       details, see mount(8).
70
71       An entry swap denotes a file or partition to be used for swapping, cf.
72       swapon(8). An entry none is useful for bind or move mounts.
73
74       More than one type may be specified in a comma-separated list.
75
76       mount(8) and umount(8) support filesystem subtypes. The subtype is
77       defined by '.subtype' suffix. For example 'fuse.sshfs'. It’s
78       recommended to use subtype notation rather than add any prefix to the
79       first fstab field (for example 'sshfs#example.com' is deprecated).
80
81   The fourth field (fs_mntops).
82       This field describes the mount options associated with the filesystem.
83
84       It is formatted as a comma-separated list of options and is optional
85       for mount(8) or swapon(8). The usual convention is to use at least
86       "defaults" keyword there.
87
88       It usually contains the type of mount (ro or rw, the default is rw),
89       plus any additional options appropriate to the filesystem type
90       (including performance-tuning options). For details, see mount(8) or
91       swapon(8).
92
93       Basic filesystem-independent options are:
94
95       defaults
96           use default options. The default depends on the kernel and the
97           filesystem. mount(8) does not have any hardcoded set of default
98           options. The kernel default is usually rw, suid, dev, exec, auto,
99           nouser, and async.
100
101       noauto
102           do not mount when mount -a is given (e.g., at boot time)
103
104       user
105           allow a user to mount
106
107       owner
108           allow device owner to mount
109
110       comment
111           or x-<name> for use by fstab-maintaining programs
112
113       nofail
114           do not report errors for this device if it does not exist.
115
116   The fifth field (fs_freq).
117       This field is used by dump(8) to determine which filesystems need to be
118       dumped. Defaults to zero (don’t dump) if not present.
119
120   The sixth field (fs_passno).
121       This field is used by fsck(8) to determine the order in which
122       filesystem checks are done at boot time. The root filesystem should be
123       specified with a fs_passno of 1. Other filesystems should have a
124       fs_passno of 2. Filesystems within a drive will be checked
125       sequentially, but filesystems on different drives will be checked at
126       the same time to utilize parallelism available in the hardware.
127       Defaults to zero (don’t check the filesystem) if not present.
128

FILES

130       /etc/fstab, <fstab.h>
131

NOTES

133       The proper way to read records from fstab is to use the routines
134       getmntent(3) or libmount.
135
136       The keyword ignore as a filesystem type (3rd field) is no longer
137       supported by the pure libmount based mount utility (since util-linux
138       v2.22).
139

HISTORY

141       The ancestor of this fstab file format appeared in 4.0BSD.
142

SEE ALSO

144       getmntent(3), fs(5), findmnt(8), mount(8), swapon(8)
145

REPORTING BUGS

147       For bug reports, use the issue tracker at
148       https://github.com/util-linux/util-linux/issues.
149

AVAILABILITY

151       fstab is part of the util-linux package which can be downloaded from
152       Linux Kernel Archive
153       <https://www.kernel.org/pub/linux/utils/util-linux/>.
154
155
156
157util-linux 2.39.2                 2023-08-17                          FSTAB(5)
Impressum