How to Get the Complete and Exact List of Mounted File Systems in Linux?

In Linux, the mount is the process to link the external device or file system to the Linux file system. It tells the system that the file system or the device is ready to use and performs operations, such as assigning the particular directory. The purpose of getting the list of mounted file systems is to check the availability of mounted file systems in Linux.

This article will provide various ways to get the complete and exact list of the mounted file systems.

Method 1: Through “findmnt” Utility

The “findmnt” is the built-in utility of Linux that is considered for displaying the list of mounted file systems. Different examples are considered to visualize the existing mounted file systems via the “findmnt” command:

Example 1: List Mounted File System 

To list all mounted files in the system, run the “findmnt” command with the “l” flag:

$ findmnt -l

All the mounted file systems are listed.

Example 2: Filter the Mounted File System with a Particular Type 

To display the specific mount file system, use the “findmnt” command by specifying the particular file type systems such as “ext4” in the following command:

$ findmnt --fstab -t ext4

The command is described as

  • findmnt” command for the mount file system.
  • fstab” flag refers to a search in the file system table. 
  • t” flag defines the type of the file system. 
  • ext4” is the system file type.

The file system type of “ext4” is listed.

Example 3: Filter the Mounted File System with Mount Point

To search for the mounted file using mount point:

$ findmnt --fstab /boot/efi

The command is described as

  • findmnt” command for the mount file system.
  • fstab” flag to search in the file system table. 
  • /boot/efi” is the mounting point. 

The mounted file system is searched through the “/boot/efi” mounting point.

Method 2: Through “df” Utility

The “df” is the built-in utility of the Linux operating systems examined for displaying the free disk space. It can also be used for retrieving information from the file system. Use the following command in the terminal for getting the mounted file list:

$ df -h --output=source,target

The command is described as

  • h” flag to display output in a human-readable format. 
  • output” flag to display only defined columns (source and target). 

The output shows that the mounted file systems have been listed in the terminal.

Detailed Information of the Mounted List

To display the detailed information of the mounted list, such as file system type, total size, used, and available space, use the “T” flag for the file system type and the “h” flag for human readable format:

$ df -hT

All columns “Filesystem”, “Type”, “size”, “Used”, “Avail” spaces and “Mounted on” point has been listed.

Method 3: Through lsblk Utility

The “lsblk” is the built-in utility for getting information about all available or blocked devices. It displays the file system information with its type and mounting point. The user can consider the “lsblk” utility for listening down the mounted file system, run the “lsblk” with the “f” flag, which refers to the file system:

$ lsblk -f

The “NAME”, “FSTYPE”, and “MOUNTPOINTS” have been listed.

Method 4: Through “/proc/mounts” File

The mounted file system is stored in the “/proc/mounts” file that can be viewed using the “cat” command:

$ cat /proc/mounts

The mounted file system information is listed but this is not the user-friendly output.

Note: Alternatively, you can also access the “/etc/mtab” file or run the “mount -l” command  to get the same output:

Conclusion

In Linux, the built-in “findmnt”, “df” and “lsblk” utilities are considered to get the complete and exact list of the mounted file system. Apart from this, the “/proc/mounts”, “/etc/mtab” files, or the “mount -l” command can also be used for viewing the mounted file system list.

 This write-up has covered the various ways to get the list of the mounted file system.