How to Inspect Disk Partitions and Filesystem Usage in Linux Using duf

The standard Unix df -h command has served as the foundational disk free utility for decades. However, its monochrome, unformatted output is difficult to parse quickly across modern systems containing dozens of virtual snap mounts, loop devices, transient tmpfs RAM disks, Docker overlay filesystems, and remote NFS shares. System administrators often waste time manually filtering output through grep just to identify physical hard drive capacities.

The duf (Disk Usage/Free Utility) command-line tool, written in Go, provides an intuitive, color-coded replacement. Featuring automatic terminal width detection, proportional ASCII progress bars, automatic grouping by storage device type (local, special, and network), and comprehensive sorting controls, duf provides immediate storage visibility.

Installing duf Across Linux Distributions

The duf utility is available in modern official package archives across major distributions:

  1. On Ubuntu, Debian, and Linux Mint:
sudo apt update && sudo apt install -y duf
  1. On Fedora, RHEL, and CentOS Stream:
sudo dnf install -y duf
  1. On Arch Linux and Manjaro:
sudo pacman -S duf

Running duf and Understanding Default Device Grouping

To inspect your server storage, run the utility without arguments:

duf

Unlike df, duf automatically filters out pseudo-filesystems by default and segments mounted storage into logical tables:

  • Local Devices: Displays physical NVMe drives, SSDs, and rotational HDDs formatted with filesystems such as ext4, XFS, or Btrfs.
  • Shared Devices: Shows remote network mounts such as NFS shares or Samba (CIFS) volumes.
  • Visual Bar: Features a color-coded percentage bar indicating available (green), occupied (blue), and critical capacity thresholds (red).

Displaying All Filesystems Including Virtual Mounts

If you are troubleshooting temporary memory file allocations or Docker container overlays:

  1. To show all filesystems (including tmpfs RAM disks and read-only loopback mounts):
duf --all
  1. To inspect only specific storage categories:
duf --only local       # Show physical drives only
duf --only network     # Show NFS and CIFS shares only
duf --only fuse        # Show user-space filesystems (like rclone or sshfs)

Filtering and Sorting Partitions

When auditing large storage servers with numerous partition slices:

  1. Sort output by available free space:
duf --sort avail
  1. Sort output by total storage capacity:
duf --sort size
  1. Display inode usage instead of byte size (vital for finding inode exhaustion caused by millions of micro-files):
duf --inodes

Exporting Storage Data in Machine-Readable JSON

For automated server health monitoring scripts or dashboard integration:

  1. Export raw storage metrics formatted as structured JSON:
duf --json
  1. Parse specific volume free percentages directly using jq:
duf --json | jq '.[] | {mount: .mount_point, free_percent: .avail_percent}'

Replacing legacy df aliases with duf gives administrators instant, readable insights into filesystem allocation across all physical and cloud Linux instances.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.