Overview
findmnt queries detailed information about mounted file systems on the current system based on data from sources like `/etc/fstab`, `/etc/mtab`, and `/proc/self/mountinfo`. It particularly excels at visualizing mount relationships in a tree format for easy understanding.
Key Features
- Visualizes mounted file systems in a tree format
- Supports various filtering options (type, source, target, etc.)
- Provides JSON and RAW output formats
- Offers functionality to query fstab file information
Key Options
findmnt allows you to control the output format and content through various options.
Output Format
Filtering
Information Source
Generated command:
Try combining the commands.
Description:
`findmnt` Executes the command.
Combine the above options to virtually execute commands with AI.
Usage Examples
Various usage examples of the findmnt command.
Display Basic Mount Information
findmnt
Shows all mounted file systems on the current system in a tree format.
Output in List Format
findmnt -l
Outputs mount information in a regular list format instead of a tree.
View Only Specific File System Types
findmnt -t ext4
For example, outputs only file systems of type 'ext4'.
View Information for a Specific Mount Point
findmnt -T /boot
For example, displays detailed information for the '/boot' mount point.
Output All Columns in JSON Format
findmnt --json -D
Outputs all mount information in JSON format, which is easy to parse by scripts or other programs.
Check fstab File Contents
findmnt --fstab
Outputs the contents defined in the `/etc/fstab` file, rather than the currently mounted file systems.
Tips & Notes
findmnt is a very useful tool for system administration and troubleshooting. Use the following tips to use it more efficiently.
Utilizing JSON Output
The `findmnt --json` option is highly beneficial for parsing mount information in scripts. When used with tools like `jq`, you can extract specific fields or perform complex queries.
- Useful for script automation
- Use in conjunction with JSON parsers like jq
- Facilitates extraction and analysis of specific information
Comparing fstab and Actual Mounts
By using the `--fstab` option, you can compare the contents defined in `/etc/fstab` with the actual mounted state to identify system configuration errors.
- Diagnosing system boot issues
- Identifying unexpected mount errors
- Verifying fstab configurations
Use in Troubleshooting
When file system related issues occur, findmnt helps quickly identify which device is mounted where, and with what options.