Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 19. Persistently mounting file systems


As a system administrator, you can persistently mount file systems to configure non-removable storage.

19.1. The /etc/fstab file

Use the /etc/fstab configuration file to control persistent mount points of file systems. Each line in the /etc/fstab file defines a mount point of a file system.

It includes the following fields separated by white space:

  • The block device identified by a persistent attribute or a path in the /dev directory.
  • The directory where the device will be mounted.
  • The file system on the device.
  • Mount options for the file system, which includes the defaults option to mount the partition at boot time with default options. The mount option field also recognizes the systemd mount unit options in the x-systemd.option format.
  • Backup option for the dump utility.
  • Check order for the fsck utility.
Note

The systemd-fstab-generator dynamically converts the entries from the /etc/fstab file to the systemd-mount units. The systemd auto mounts LVM volumes from /etc/fstab during manual activation unless the systemd-mount unit is masked.

Example 19.1. The /boot file system in /etc/fstab

Expand
Block deviceMount pointFile systemOptionsBackupCheck

UUID=ea74bbec-536d-490c-b8d9-5b40bbd7545b

/boot

xfs

defaults

0

0

The systemd service automatically generates mount units from entries in /etc/fstab.

For more information, see the fstab(5) and systemd.mount(5) man pages on your system.

19.2. Adding a file system to /etc/fstab

Configure persistent mount point for a file system in the /etc/fstab configuration file.

Procedure

  1. Find out the UUID attribute of the file system:

    $ lsblk --fs storage-device
    Copy to Clipboard Toggle word wrap

    For example, view the UUID of a partition:

    $ lsblk --fs /dev/sda1
    
    NAME FSTYPE LABEL UUID                                 MOUNTPOINT
    sda1 xfs    Boot  ea74bbec-536d-490c-b8d9-5b40bbd7545b /boot
    Copy to Clipboard Toggle word wrap
  2. If the mount point directory does not exist, create it:

    # mkdir --parents mount-point
    Copy to Clipboard Toggle word wrap
  3. As root, edit the /etc/fstab file and add a line for the file system, identified by the UUID.

    For example, below is the /boot mount point in /etc/fstab

    UUID=ea74bbec-536d-490c-b8d9-5b40bbd7545b /boot xfs defaults 0 0
    Copy to Clipboard Toggle word wrap
  4. Regenerate mount units so that your system registers the new configuration:

    # systemctl daemon-reload
    Copy to Clipboard Toggle word wrap
  5. Try mounting the file system to verify that the configuration works:

    # mount mount-point
    Copy to Clipboard Toggle word wrap
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat