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

Chapter 17. Mounting file systems


As a system administrator, you can mount file systems on your system to access data on them.

17.1. The Linux mount mechanism

On Linux, UNIX, and similar operating systems, file systems can exist on different partitions and removable devices. Examples include CDs, DVDs, and USB flash drives. These file systems can be attached to a specific point in the directory tree, called a mount point. They can also be detached again. While a file system is mounted on a directory, the original content of the directory is not accessible.

Linux does not prevent you from mounting a file system to a directory with a file system already attached to it.

When mounting, you can identify the device by:

  • a universally unique identifier (UUID): for example, UUID=34795a28-ca6d-4fd8-a347-73671d0c19cb
  • a volume label: for example, LABEL=home
  • a full path to a non-persistent block device: for example, /dev/sda3

When you mount a file system by using the mount command without all required information, the command relies on defaults. This includes cases where the device name, target directory, or file system type is missing. In such cases, the mount utility reads the contents of the /etc/fstab file. It checks whether the given file system is listed there.

The /etc/fstab file contains a list of device names and directories. These directories indicate where the selected file systems are mounted. The file also specifies the file system type and mount options. Therefore, when mounting a file system that is listed in /etc/fstab, the following command syntax is sufficient.

  • Mounting by the mount point:

    # mount directory
  • Mounting by the block device:

    # mount device

17.2. Listing currently mounted file systems

List all currently mounted file systems on the command line by using the findmnt utility.

Procedure

  • To list all mounted file systems, use the findmnt utility:

    $ findmnt
  • To limit the listed file systems only to a certain file system type, add the --types option:

    $ findmnt --types fs-type

    For example below is an example to list only XFS file systems:

    $ findmnt --types xfs
    TARGET  SOURCE                                                FSTYPE OPTIONS
    /       /dev/mapper/luks-5564ed00-6aac-4406-bfb4-c59bf5de48b5 xfs    rw,relatime
    ├─/boot /dev/sda1                                             xfs    rw,relatime
    └─/home /dev/mapper/luks-9d185660-7537-414d-b727-d92ea036051e xfs    rw,relatime

17.3. Mounting a file system with mount

Mount a file system by using the mount utility.

Prerequisites

  • Verify that no file system is already mounted on your chosen mount point:

    $ findmnt mount-point

Procedure

  1. To attach a certain file system, use the mount utility:

    # mount device mount-point

    For example, to mount a local XFS file system identified by UUID:

    # mount UUID=ea74bbec-536d-490c-b8d9-5b40bbd7545b /mnt/data
  2. If mount cannot recognize the file system type automatically, specify it by using the --types option:

    # mount --types type device mount-point

    For example, to mount a remote NFS file system:

    # mount --types nfs4 host:/remote-export /mnt/nfs

17.4. Moving a mount point

Change the mount point of a mounted file system to a different directory by using the mount utility.

Procedure

  1. To change the directory in which a file system is mounted:

    # mount --move old-directory new-directory

    For example, to move the file system mounted in the /mnt/userdirs/ directory to the /home/ mount point:

    # mount --move /mnt/userdirs /home
  2. Verify that the file system has been moved as expected:

    $ findmnt
    $ ls old-directory
    $ ls new-directory

17.5. Unmounting a file system with umount

Unmount a file system by using the umount utility.

Procedure

  1. Try unmounting the file system by using either of the following commands:

    • By mount point:

      # umount mount-point
    • By device:

      # umount device

    If the command fails with an error similar to the following, it means that the file system is in use because of a process is using resources on it:

    umount: /run/media/user/FlashDrive: target is busy.
  2. If the file system is in use, use the fuser utility to determine which processes are accessing it. For example:

    $ fuser --mount /run/media/user/FlashDrive /run/media/user/FlashDrive: 18351

    Afterwards, stop the processes by using the file system and try unmounting it again.

17.6. Mounting and unmounting file systems in the web console

To be able to use partitions on RHEL systems, you need to mount a file system on the partition as a device.

Note

You also can unmount a file system and the RHEL system will stop using it. You can delete, remove, or re-format devices by unmounting the file system.

Prerequisites

  • The cockpit-storaged package is installed on your system.
  • You have installed the RHEL 10 web console.

    For instructions, see Installing and enabling the web console.

  • If you want to unmount a file system, ensure that the system does not use any file, service, or application stored in the partition.

Procedure

  1. Log in to the RHEL 10 web console.
  2. Click the Storage tab.
  3. In the Storage table, select a volume from which you want to delete the partition.
  4. In the GPT partitions section, click the menu button, next to the partition whose file system you want to mount or unmount.
  5. Click Mount or Unmount.

17.7. Common mount options

The mount utility supports various options for controlling file system behavior, access permissions, and mounting preferences across different file system types.

The following table lists the most common options of the mount utility. You can apply these mount options by using the following syntax:

# mount --options option1,option2,option3 device mount-point
Expand
Table 17.1. Common mount options
OptionDescription

async

Enables asynchronous input and output operations on the file system.

auto

Configures the file system for automatic mounting when the mount -a command is used.

defaults

Provides an alias for the async,auto,dev,exec,nouser,rw,suid options.

exec

Specifies that binary files can be executed on the file system.

loop

Mounts an image as a loop device.

noauto

Default behavior disables the automatic mount of the file system by using the mount -a command.

noexec

Disallows the execution of binary files on the particular file system.

nouser

Disallows an ordinary user (that is, other than root) to mount and unmount the file system.

remount

Remounts the file system in case it is already mounted.

ro

Mounts the file system for reading only.

rw

Mounts the file system for both reading and writing.

user

Specifies that non-root users can mount and unmount the file system.

Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Ü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.

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 Dokumentation

Legal Notice

Theme

© 2026 Red Hat
Nach oben