Mastering Linux findmnt: Inspect Mount Points & Filesystems

Overview

Modern Linux administrators frequently need to audit mounted partitions, virtual pseudo-filesystems, and dynamic block devices. While traditional utilities like mount dump overwhelming blocks of raw text, the findmnt command delivers an intuitive, tree-oriented breakdown of your active storage hierarchy. In this walkthrough, we explore practical techniques to inspect filesystem relationships, query specific storage targets, and streamline automation workflows using findmnt.

Exploring Filesystem Hierarchies via Default Tree and List Views

Begin by checking which release of findmnt is installed on your machine using findmnt --version.
Executing this utility prints package details sourced directly from the core util-linux suite.

Check findmnt version

Invoking findmnt with no arguments produces a clean, structured tree displaying every active filesystem attached to the host.
By rooting the output at /, this visualization clearly reveals parent-child inheritance across dynamic mounts, subvolumes, and bind mounts at a glance.
⚙️ [Essential CLI Flags]

-l : Flattens the hierarchy into a clean linear list instead of rendering ASCII branch trees.
-t : Constrains output to designated filesystem drivers, such as ext4, xfs, or in-memory tmpfs.
-s : Queries configured fstab definitions in /etc/fstab rather than active kernel state.
-m : Reads filesystem tables directly from legacy /etc/mtab tracking.
-k : Inspects kernel-level mounts by referencing /proc/self/mountinfo.
-o : Customizes printed columns (e.g., TARGET, SOURCE, FSTYPE, OPTIONS).
-r : Disables table alignment and spacing to output lightweight, unformatted raw records.

Default findmnt tree output

Passing findmnt -l strips away branches, returning each mount entry in a straightforward tabular layout.
Because every entry occupies a single line, this format integrates seamlessly with standard shell processing pipelines like grep, sed, or awk.

Linear list view with findmnt -l

Pinpointing Mounts by Directory Path and Hardware Device

To interrogate where the root partition originates and how it behaves, run findmnt /.
The resulting report highlights the mount destination (TARGET), underlying storage device (SOURCE), partition type (FSTYPE), and active operational flags (OPTIONS).

Query root filesystem status

Execute findmnt /boot to verify whether your system mounts /boot onto a dedicated block partition.
If /boot simply resides on the main root partition rather than its own dedicated storage volume, the command returns zero rows and exits quietly.

Check dedicated boot partition

Run findmnt -S /dev/sda1 || findmnt -S /dev/vda1 || findmnt / to probe common physical or virtual disk identifiers, gracefully defaulting back to the root mount point if neither device node exists.
Constructing chained fallback statements with || guarantees robust execution across distinct platforms, whether running on bare-metal hardware, cloud hypervisors, or lightweight container instances.

Inspect block device fallback chain

Filtering by Filesystem Driver and Validating fstab Integrity

To isolate conventional block-level volumes, run findmnt -t ext4 to exclude all non-ext4 mounts.
In virtualized setups or Docker hosts, this quickly exposes persistent container bind mounts linked to the host’s underlying storage.

Filter ext4 mounts

Execute findmnt -t tmpfs to reveal all RAM-backed volatile partitions currently hosted in system memory.
System daemons routinely rely on tmpfs targets such as /dev, /dev/shm, /run, and /tmp for low-latency scratch storage and inter-process communication buffers.

Filter memory-backed tmpfs mounts

System updates to persistent storage tables require caution; executing findmnt --verify audits /etc/fstab for broken syntax, missing devices, or invalid flags.
A clean audit outputs “Success, no errors or warnings detected”, providing confidence that future host reboots will complete without mounting failures.

Validate fstab configurations with findmnt –verify

Customizing Output Fields and Automating with Script-Friendly Formats

When standard tables include unnecessary noise, restrict output to target parameters with findmnt -o TARGET,SOURCE,FSTYPE,OPTIONS.
Tailoring the column projection helps operators focus exclusively on critical configuration settings during routine diagnostic inspections.

Project custom columns

Pass findmnt -J -o TARGET,SOURCE,FSTYPE to serialize filesystem relationships directly into standard JSON objects.
The nested children tree produced by JSON mode makes programmatic traversal effortless inside Python scripts, Ansible playbooks, or pipelines leveraging jq.

Serialize mount trees to JSON

For shell automation, combining options into findmnt -r -n -o TARGET strips column headers (-n) and tree formatting (-r), printing raw mount directories one per line.
This bare-bones listing feeds directly into shell while loops, batch processing tasks, and monitoring agents without requiring secondary text sanitization.

Generate raw target lists for scripts

Mastering findmnt transforms filesystem administration from guesswork into an efficient, predictable process.
Incorporate these filtering techniques and output formats into your daily maintenance routines and automation scripts to diagnose storage configurations with speed and accuracy.