Skip to content

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:

lsblk -o SOURCE,NAME,FSTYPE,MOUNTPOINT -l -n
  • -o selects columns. SOURCE shows the device path (e.g., /dev/sda1, UUID="...", or LABEL="..." depending on the environment).
  • -l limits output to leaves (actual mounts), excluding directories and subvolumes.
  • -n omits the header, making it script-friendly.

Example output:

/dev/sda1   sda1  ext4  /boot
UUID/1234   nvme0n1p2  xfs  /

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:

findmnt -o SOURCE -r -n
  • -o SOURCE selects the source column.
  • -r recurses into sub-mounts (similar to -l’s leaf-only, but from the mount tree root).
  • -n suppresses headers.

You can also target a specific mount path:

findmnt -o SOURCE /var
# /dev/sda2

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:

ColumnlsblkfindmntTypical Use
SOURCEDevice node, UUID, or LABELMount source (fstab/unit/path)Identifying origin
FSTYPEfs-type columnfstype columnFilesystem check, automation
OPTIONSMount options from /etc/mtaboptions columnPrivileged 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

findmnt -o SOURCE,FSTYPE,OPTIONS -n /opt
# OUTPUT: /dev/mapper/vg0-opt   xfs   rw,relatime,seclabel

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

lsblk -o SOURCE,FSTYPE,MOUNTPOINT -n -l | awk '$2 == "ext4"'

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

findmnt -o SOURCE -U -n /var/lib/docker
# Might output: UUID "abc-123" or "/dev/sdb1"

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.