df
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 devtmpfsInodes exhausted?
df -ihMillions 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/dockerShows the mount that holds that path (critical with bind mounts).
Portable scripting
df -P / | tail -1
df -P --output=target,pcent /varJSON-ish via findmnt (often clearer)
findmnt -D
findmnt -no TARGET,FSTYPE,USE% /Correlate devices
df -hT
lsblk -f
findmntRoot 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
-hin scripts — use-Por--outputbytes fields.
2026-relevant notes
- Prefer
dufinteractively; keepdfin scripts and alerts. - Container hosts: full
/var/lib/containerdor docker roots are common;dfthe right mount. - Metrics: node exporters scrape the same ideas — alert on both block and inode %.
Additional Resources
man df