df

Updated

September 4, 2026

Overview

df reports filesystem disk space usage for mounted filesystems. First stop for “is the disk full?” before descending into per-directory du/dust/ncdu. It answers capacity questions at mount granularity, not “which folder is large?”.

Syntax

df [options] [file...]

When given a path, reports the filesystem containing that path.

Common Options

Option Description
-h, --human-readable Sizes in powers of 1024
-H Powers of 1000
-T Print filesystem type
-i Inode usage instead of blocks
-l Local filesystems only
-P POSIX output format (stable columns)
--output=FIELD_LIST Select columns (GNU)
-t type / -x type Include / exclude filesystem type
-a Include pseudo, duplicate, inaccessible

Examples with Explanations

Everyday overview

df -h
df -hT
df -h -x tmpfs -x devtmpfs

Inodes exhausted?

df -ih

Millions of tiny files can exhaust inodes while df -h still shows free blocks — common on mail spool or container image layers.

Specific path

df -h /var
df -h .
df -h /var/lib/docker

Shows the mount that holds that path (critical with bind mounts).

Portable scripting

df -P / | tail -1
df -P --output=target,pcent /var

JSON-ish via findmnt (often clearer)

findmnt -D
findmnt -no TARGET,FSTYPE,USE% /

Correlate devices

df -hT
lsblk -f
findmnt

Root reserved space

On ext*, ~5% may be reserved for root. Use% at 100% can still allow root writes; non-root fails earlier.

Understanding output

Field Meaning
Filesystem Device or source
Size / Used / Avail Block capacity
Use% Used / size (rounding applies)
Mounted on Mountpoint
Type (-T) ext4, xfs, btrfs, nfs, …

Notes / Pitfalls

  • tmpfs/overlay/snap noise hides real disks — filter with -x / -t / duf -only local.
  • NFS free space can reflect server quotas, not your expectation.
  • Btrfs/ZFS free space may need native tools for accurate “allocatable” views.
  • Deleted-but-open files still consume space until close (lsof + (deleted)).
  • Don’t parse human -h in scripts — use -P or --output bytes fields.

2026-relevant notes

  • Prefer duf interactively; keep df in scripts and alerts.
  • Container hosts: full /var/lib/containerd or docker roots are common; df the right mount.
  • Metrics: node exporters scrape the same ideas — alert on both block and inode %.

Additional Resources

  • man df