Linux mount Command: Inspect and Mount Filesystems

mount connects a file system to the directory tree or checks the current mount status. It is the operation that allows you to read and write files in a directory after connecting a device.

What is the mount command?

The target directory for mounting must already exist. Mounting a file system over it does not delete the existing directory contents, but they are hidden until the mount is removed. Running it without arguments shows a list of currently connected file systems, and for structured queries, findmnt is convenient.

Basic syntax

mount [option] [device] [mount point]

The installed implementation and options may vary depending on the distribution. Check the description of the current system with man mount.

Examples

Check current connection status

Check which file system the specified path belongs to.

findmnt /mnt/data

Mount as read-only

After verifying that it matches the target device and content, mount it as read-only.

sudo mount -o ro /dev/sdb1 /mnt/data

Connection Result Verification

Check the device, format, and read-only options.

findmnt /mnt/data

Check where it is visible after mounting

mount connects a device's filesystem to the directory tree. When you only want to check the status, it is easier to look up the source and type of a specific path with findmnt.

findmnt /mnt/data

Example output of a mounted environment:

TARGET    SOURCE    FSTYPE OPTIONS
/mnt/data /dev/sdb1 ext4   rw,relatime

When the mount succeeds, mount itself usually does not produce any output. Files originally in the mount point may be hidden while it is mounted, so check to make sure it is an empty directory before performing any operations. If you select the wrong device, partition, or filesystem, you may read or write unexpected data.

For a mount to persist across reboot, a one-time mount command is not enough; configure /etc/fstab or the appropriate mount unit. Device names can change between boots, so prefer a verified UUID where appropriate and validate the configuration according to your operating procedure.

Main Options and Format

Options/Format Description
-o ro Mount as read-only.
-t format Specify the file system format.
-o option list Specify mount options separated by commas.
-a Mount all targets specified in the configuration file at once.
--bind Reattach an existing directory to a different location.

Precautions when using

Replace the example /dev/sdb1 and /mnt/data with the actual target, and check the data and mount status with lsblk -f before performing any operation. Mounting a filesystem that is already mounted elsewhere can cause confusion. Permanent mounting requires separate configuration in /etc/fstab, and incorrect settings can affect booting.

Frequently Asked Questions

If I run mount, will it persist after reboot?

A one-time mount performed with a command generally does not automatically restore after reboot. Automatic mounting requires separate configurations such as in /etc/fstab.

Official Documentation

You can check the exact behavior of options and implementation differences in the official mount documentation.

More in This Category
Linux Administration Memo: Essential Commands and System Checks

Linux Administration Memo: Essential Commands and System Checks

A compact Linux administration reference for checking system information, processes, storage, networking, users, permissions, services, and logs.

Linux more Command: View Text One Screen at a Time

Linux more Command: View Text One Screen at a Time

Learn how to use Linux more to read text one screen at a time, move and search interactively, start at a line or pattern, and choose between more and less.

Linux kill Command: Send a Signal to a Process ID

Linux kill Command: Send a Signal to a Process ID

Learn how to send a Signal to a Process ID with the Linux kill command, including practical examples, key options, and important precautions.

Linux chgrp Command: Change a File's Group

Linux chgrp Command: Change a File's Group

Learn how to change a File's Group with the Linux chgrp command, including practical examples, key options, and important precautions.

Linux groups Command: Show a User's Group Memberships

Linux groups Command: Show a User's Group Memberships

Learn how to show a User's Group Memberships with the Linux groups command, including practical examples, key options, and important precautions.

Linux watch Command: Run a Command Repeatedly

Linux watch Command: Run a Command Repeatedly

Learn how to use the Linux watch command to rerun a command at regular intervals and highlight changing output, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux Tutorial / File System Basics: Paths and Key Directories

Linux Tutorial / File System Basics: Paths and Key Directories

Understand the Linux directory tree, read absolute and relative paths, and learn what common directories such as /home, /etc, and /var are used for.

Linux basename Command: Extract the Final Component of a Path

Linux basename Command: Extract the Final Component of a Path

Learn how to use the Linux basename command to remove directory prefixes and optional suffixes from path strings, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux dmesg Command: Read Kernel and Boot Messages

Linux dmesg Command: Read Kernel and Boot Messages

Learn how to read Kernel and Boot Messages with the Linux dmesg command, including practical examples, key options, and important precautions.

Linux screen Command: Create and Manage Detachable Terminal Sessions

Linux screen Command: Create and Manage Detachable Terminal Sessions

Learn how to use the Linux screen command to keep terminal sessions running and reconnect to them later, with essential options, practical examples, output interpretation, and common troubleshooting tips.