Setting default mounts and options in fstab
In the previous section, we introduced how disks and partitions can be mounted so that our services and users can make use of them. In this section, we will learn how to make those filesystems available in a persistent way.
The /etc/fstab
file contains the filesystem definitions for our system. Of course, it also has a dedicated manual page that can be checked with man fstab
. It contains useful information about the formatting, fields, ordering, and more that must be taken into consideration, as this file is critical for the smooth operation of the system.
The file format is defined by several fields separated by tabs or spaces, with lines starting with a #
character considered as comments.
For example, we will use this line to look at each field description:
LABEL=/ / xfs defaults 0 0 [.1.] [2] [3] [..4..] [5][6]
The first field is the device definition, which can be a special block device, a remote filesystem, or—as...