How to Check if a Filesystem is Mounted in Linux?

In Linux, a “mount” is the process of making a file system accessible at a certain point in the directory tree. This directory or the location is known as the “mount point”. The purpose of mounting a file system is to make it accessible to the system and its users so that files and directories within the file system can be read, written, and manipulated.

This tutorial will illustrate different methods to check if the filesystem is mounted in Linux. 

Method 1: Using mount Command 

The “mount” command is utilized to list all the currently mounted file systems. It is a method to discover all filesystems in the system. For instance, type the “mount” command without any argument as below:

$ mount

The output will list all currently mounted filesystems, including “sysfs”, “proc”, “devtmpfs”, “ext4”, and many more in the terminal.

Method 2: Using df Command

The “df” command is utilized to check whether the filesystem is mounted. It shows the file systems and their mount points, as well as usage statistics:

$ df

The output returns the available disk space on all mounted filesystems. 

Method 3: Using lsblk Command

The “lsblk” command shows a tree-like representation of the file systems and their mount points. If the file system you’re interested in is listed, execute the “lsblk” command:

$ lsblk

This output lists all block devices and their associated filesystems. If the filesystem you want to check is mounted, it will be listed under the “MOUNTPOINT” column.

Method 4: Using the “/proc/mounts” File

The “/proc/mounts” file has a list of mounted file systems and their mount points. Users can utilize the “cat” command to display the content in the file system to check the mounted filesystem:

$ cat /proc/mounts

The outcome of the above command represents all currently mounted filesystems.

Method 5: Using the findmnt Command

The “findmnt” command is similar to the “mount” command but more flexible and user-friendly. It can filter, search and list the mounted filesystems as below:

$ findmnt

The output lists all mounted file systems and other information.

Method 6: Using Disks Application (GUI-based)

To check if a file system is mounted in Linux, use the “Disks” application. It is a GUI tool for managing storage devices on Linux. The Disks application can be accessed through the main menu or by searching for “Disks” in the launcher. Once the Disks application is opened, it will show all the connected storage devices and their partitions as below:

The mounted partitions will have a mount point (/boot/efi) highlighted in the above figure.

Conclusion

Linux offers “mount”, “df”, “cat /proc/mounts”, “lsblk”, and “findmnt” commands to check the mounted filesystem. All these commands will show the current file systems mounted in the system and the path where they are mounted. Additionally, users can visualize through the “Disks” application. This article has briefly explained different methods to check the mounted filesystem in Linux.