Open In App

How to Mount File System in Linux | mount Command

Last Updated : 11 Jul, 2025
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

The mount command connects storage devices or file systems (like EXT4, NTFS, or FAT32) to directories known as mount points. Once mounted, everything inside that mount point reflects the contents of the attached storage.

Syntax

Below is the syntax for the mount command:

sudo mount [options] <device> <mount_point>

here,

  • device: the partition you want to mount.
  • mount point: the directory where the device will be mounted
  • options: different mount options that modify the command behaviour.

Common Options

Linux uses a common file tree to manage files from multiple sources. You can attach devices (USBs, hard disks, network shares) to mount points. Here are some frequently used options with the mount command:

OptionDescription
-t <type>Specifies the file system type (e.g., ext4ntfsvfatnfs).
-o <options>Mount options (e.g., ro for read-only, rw for read-write).
-aMounts all file systems listed in /etc/fstab.
-lLists all currently mounted file systems.
--bindBinds a directory to another location (useful for creating mirrors).

Understanding File Systems Available for Linux

Before we dive into the practical aspects of mounting file systems, let's take a moment to understand what file systems are available on our Linux system. Open a terminal and use the following command to list the supported file systems:

cat /proc/filesystems
file system available
file system available

This command provides a list of file system types that Linux supports. Additionally, you can explore more detailed information using the manual:

man filesystems

This manual provides documentation on various file systems that Linux can work with.

How to List Currently Mounted File Systems on Linux

Now, let's see what file systems are currently mounted on our Linux system. The mount command allows us to view this information easily:

mount
list mounted file system
list mounted file system

This command displays a list of currently mounted file systems. If you are curious about the static file systems, you can view them in the `/etc/fstab` file:

cat /etc/fstab
static filesystem
static filesystem

To explore mounted file systems in a tree structure, you can use the `findmnt` command:

findmnt

If you want to narrow down the output to a specific type of file system, you can do so with filters:

findmnt -t ext4

And if you're interested in block devices, the lsblk command is handy:

lsblk

How to Mount File Systems on Linux

Now that we've covered the basics let's move on to the practical aspects of mounting file systems on Linux. Mounting can be a temporary or permanent operation, and it's typically performed by an administrator, either by logging in as the root user or by using the sudo command.

Syntax of mount Command

mount -t type device dir

Other forms:

mount [-l|-h|-V]
mount -a [-fFnrsvw] [-t fstype] [-O optlist]
mount [-fnrsvw] [-o options] device|dir
mount [-fnrsvw] [-t fstype] [-o options] device dir

These commands tell the Kernel to attach the filesystem found at device to the dir.

Note:

  • If you leave the dir part of syntax it looks for a mount point in /etc/fstab.
  • You can use --source or --target to avoid ambivalent interpretation.
    mount --target /mountpoint
  • /etc/fstab usually contains information about which device is need to be mounted where.
  • Most of the devices are indicated by files like /dev/sda4, etc. But it can be different for certain filesystems. Please refer below for more information.
    man mount

Note: It is important to note that we are only discussing the standard form of mount command given as syntax. Different forms are somewhat discussed because it has certain limitations on different kernels.

How to Unmount File Systems on Linux

It is also important for a user to understand how to unmount file system on Linux to avoid any data corruption. Below is the supporting example to unmount file system:

umount /mnt

This will unmount the file system from the /mnt directory. Make sure no files are being used from the mounted device before you unmount it.

Options Available in mount Command

The mount command has several options that can be used to modify how a file system is mounted. Below are some of the most commonly used mount options:

Options

Description

l

Lists all the file systems mounted yet.

h

Displays options for command.

V

Displays the version information.

a

Mounts all devices described at /etc/fstab.

t

Type of filesystem device uses.

T

Describes an alternative fstab file.

r

Read-only mode mounted.

Examples of How to Mount File Systems on Linux

Below are the examples to help you understand how to view, attach, and check file system mounts in a Linux system.

1. Displays information about file systems mounted

Use this to see details of all currently mounted file systems and their mount points.

2. Mounts file systems

This allows you to attach a device or partition to a specific directory on your Linux system.

3. Displays version information

Use this to check the installed version of the mount utility and supported options.

4. Unmounts file systems

Detaches a mounted file system safely so it can be removed or modified.

Conclusion

The mount command in Linux is one of the best tool for managing file systems. Whether you're mounting local devices, network file systems, or managing storage, the mount command allows you to access and manipulate file systems effectively. The mount command is like plugging in a USB drive or connecting to a network location. It can be temporary, for one session, or permanent, set up to connect every time you start your computer.


Next Article
Article Tags :

Similar Reads