findmnt and lsblk: mount source
The origin of a mounted volume surfaces frequently during failure audits, environment reviews, or automatic mount setup. Both lsblk and findmnt expose a SOURCE column, but their output philosophy diverges: lsblk renders a device tree, while findmnt renders a mount-point table. The choice depends on whether you need the full device hierarchy or precise active-mount source details with options.
Introduction to the utility comparison
Both lsblk and findmnt query the kernel’s block device tree, but their output philosophy diverges. lsblk prints a tree of devices; findmnt prints a table of mount points. When you only need the SOURCE column for a given mount, findmnt is usually faster and more filterable. Conversely, lsblk gives you the full device hierarchy in one line, which is handy for scripts that need to walk up the tree or inspect partition layouts without invoking additional tools.
Commands lsblk to extract SOURCE
The canonical way to get the SOURCE column in lsblk is:
-oselects columns.SOURCEshows the device path (e.g.,/dev/sda1,UUID="...", orLABEL="..."depending on the environment).-llimits output to leaves (actual mounts), excluding directories and subvolumes.-nomits the header, making it script-friendly.
Example output:
Note that lsblk resolves SOURCE to the canonical device node by default, but you can force raw paths with --raw or show logical volumes with --logdel. For most DevOps routines the -l -n combo is sufficient to pipe into awk, grep, or configuration management templates.
Commands findmnt to extract SOURCE
findmnt is mount-point-centric. To extract the SOURCE for a specific mount (or all mounts), use:
-o SOURCEselects the source column.-rrecurses into sub-mounts (similar to-l’s leaf-only, but from the mount tree root).-nsuppresses headers.
You can also target a specific mount path:
findmnt respects /etc/fstab, systemd mount units, and mtab/proc/mounts, so the SOURCE it reports may include options like UUID=, LABEL=, or the raw /dev/sdX path depending on what mounted it. This makes it particularly reliable when dealing with systemd-managed mounts, where the “source” might be a unit file rather than a plain device node.
Comparison of FSTYPE and OPTIONS
Both utilities expose FSTYPE and OPTIONS, but the granularity differs:
| Column | lsblk | findmnt | Typical Use |
|---|---|---|---|
| SOURCE | Device node, UUID, or LABEL | Mount source (fstab/unit/path) | Identifying origin |
| FSTYPE | fs-type column | fstype column | Filesystem check, automation |
| OPTIONS | Mount options from /etc/mtab | options column | Privileged mounts, ro/rw |
Key difference: lsblk reads /sys and /proc/partitions, so FSTYPE may appear empty for unformatted devices. findmnt reads actual mount state, so FSTYPE is present only if the mount is active. For OPTIONS, findmnt shows the exact mount options string, while lsblk shows them only if you explicitly request -o OPTIONS. When you need to know whether a mount was performed with ro or bind, findmnt wins without extra flags.
Practical usage examples
Example 1: Find the source of a mounted volume without guessing
This is faster than cat /proc/mounts and grep, and findmnt will honor any mount wrapper or systemd unit that redirected the mount. The -o flag can be repeated to add columns incrementally.
Example 2: List all mounts where SOURCE is a UUID, and filter by FSTYPE
When you need to audit all ext4 mounts and their device origins, lsblk’s tree view makes it easy to spot volume group paths like vg0/lv_db. The -l flag ensures only leaf devices are shown, avoiding recursive directory noise.
Example 3: Resolve a mount point to its underlying device when systemd is involved
The -U flag forces UUID resolution, which is useful when you want a stable identifier independent of /dev ordering. This is particularly handy in CI/CD pipelines or configuration management where device node paths may shift across hosts.
Conclusion and recommendations
Use lsblk when you need a full device tree, want to inspect partition layouts, or script across many devices where the SOURCE column’s raw node path is sufficient. Use findmnt when your focus is active mounts, you need precise OPTIONS, or you’re working in systemd-managed environments where mount sources may be units or UUIDs rather than simple /dev/sdX nodes. In practice, keep both aliases handy: alias llblk='lsblk -o SOURCE,FSTYPE,MOUNTPOINT -n -l' and alias fm='findmnt -o SOURCE,FSTYPE,OPTIONS -n'. They complement each other and eliminate the “where did this come from?” guesswork during incident triage or storage capacity planning.