Chapter 16. Persistently mounting file systems
As a system administrator, you can persistently mount file systems to configure non-removable storage.
16.1. The /etc/fstab file
This section describes the
/etc/fstab configuration file, which controls persistent mount points of file systems. Using
/etc/fstab is the recommended way to persistently mount file systems.
Each line in the
/etc/fstab file defines a mount point of a file system. It includes six fields separated by white space:
The block device identified by a persistent attribute or a path it the
- The directory where the device will be mounted.
- The file system on the device.
Mount options for the file system. The option
defaultsmeans that the partition is mounted at boot time with default options. This section also recognizes
systemdmount unit options in the
Backup option for the
Check order for the
Example 16.1. The
/boot file system in
|Block device||Mount point||File system||Options||Backup||Check|
| || || || || || |
systemd service automatically generates mount units from entries in
16.2. Adding a file system to /etc/fstab
This procedure describes how to configure persistent mount point for a file system in the
/etc/fstab configuration file.
Find out the UUID attribute of the file system:
$ lsblk --fs storage-device
Example 16.2. Viewing the UUID of a partition
$ lsblk --fs /dev/sda1 NAME FSTYPE LABEL UUID MOUNTPOINT sda1 xfs Boot ea74bbec-536d-490c-b8d9-5b40bbd7545b /boot
If the mount point directory does not exist, create it:
# mkdir --parents mount-point
As root, edit the
/etc/fstabfile and add a line for the file system, identified by the UUID.
Example 16.3. The /boot mount point in /etc/fstab
UUID=ea74bbec-536d-490c-b8d9-5b40bbd7545b /boot xfs defaults 0 0
Regenerate mount units so that your system registers the new configuration:
# systemctl daemon-reload
Try mounting the file system to verify that the configuration works:
# mount mount-point