brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: findmnt --df gives you df output without the pseudo filesystems

Filesystems
~/tips/tip-disk-findmnt-df

findmnt --df

Show mounted filesystems in a df-style table, minus the pseudo filesystems.

Anyone who runs df on a Docker host knows the wall of overlay and tmpfs lines. findmnt has a switch that cuts that down to the real mounts.

Run it like this:

findmnt --df

The man page says –df (short form -D) imitates the output of df. It is shorthand for -o SOURCE,FSTYPE,SIZE,USED,AVAIL,USE%,TARGET but it excludes all pseudo filesystems. If you want those back, add –all.

You can narrow it to filesystem types with -t, which takes a comma-separated list, and a type prefixed with no is excluded:

findmnt --df -t ext4,xfs,btrfs
findmnt --df -t nofuse

The related -I (–dfi) option imitates df -i, so you get inode columns instead.

There are caveats in the manual. The default output of findmnt is subject to change, so a script should name its columns with –output instead of relying on –df. Using -t also switches the output to list format unless you add –submounts, so you get a flat list. And the page doesn’t say what happens when you combine –df with -o, so I wouldn’t.

For a Docker or Unraid host, where df fills a whole screen with overlay and tmpfs lines, I’d use this view first and keep plain df for the details.

Further reading: findmnt(8) manual page

More Filesystems tips sudo fsfreeze -f /srv/data filefrag /var/lib/libvirt/images/vm1.qcow2 sudo btrfs filesystem usage /mnt/pool sudo tune2fs -l /dev/sdX1 | grep -iE 'mount count|check' lsblk -f All Filesystems tips (6) All topics

Link