How to Get the List of Mounted Filesystems in Linux

Yahya Irmak Feb 02, 2024
  1. Read Contents of the /proc/mounts to Get the List of Mounted Filesystems in Linux
  2. Read Contents of the /etc/mtab to Get the List of Mounted Filesystems in Linux
  3. Use the findmnt Command to Get the List of Mounted Filesystems in Linux
  4. Use the df Command to Get the List of Mounted Filesystems in Linux
  5. Use the lsblk Command to Get the List of Mounted Filesystems in Linux
How to Get the List of Mounted Filesystems in Linux

The Linux operating system consists of a hierarchical file system. There can be many different types of file systems, ext4, tmpfs, securityfs, configfs, etc.

This article will explain how to get the list of mounted filesystems in Linux.

In Linux, you can attach a storage device such as a USB flash drive or a file system to the existing directory using the mount command and detach it from the system using the umount command.

Now let’s examine ways to access the list of file systems mounted to the system.

Read Contents of the /proc/mounts to Get the List of Mounted Filesystems in Linux

The /proc/mount contains a list of all the filesystems mounted on the system. We can read its contents with the cat command to access the list.

cat /proc/mounts

Output:

cat proc mounts

Read Contents of the /etc/mtab to Get the List of Mounted Filesystems in Linux

The /etc/mtab also contains a list of all mounted filesystems. We can read its contents with the cat command to access the list.

cat /etc/mtab

Output:

cat etc mtab

Use the findmnt Command to Get the List of Mounted Filesystems in Linux

The findmnt command finds mounted filesystems and lists them in the tree-like format. If you do not want it to use a tree-like format, you can list it with the -l parameter.

findmnt

Output:

findmnt

Use the -t parameter to list only specific filesystems.

findmnt -t ext4

Output:

findmnt -t ext4

Use the df Command to Get the List of Mounted Filesystems in Linux

The df command stands for disk free. It shows the file system’s total, used, and available disk sizes. The -h flag is used to display the sizes human-readable, and the -T flag is used to print file system type.

df -hT

Output:

df -ht

Use the lsblk Command to Get the List of Mounted Filesystems in Linux

The lsblk command finds mounted filesystems and lists them in the tree-like format. Use the -f parameter to get information about file systems.

sudo lsblk -f

Output:

lsblk

Author: Yahya Irmak
Yahya Irmak avatar Yahya Irmak avatar

Yahya Irmak has experience in full stack technologies such as Java, Spring Boot, JavaScript, CSS, HTML.

LinkedIn

Related Article - Linux File