Skip to content

Reading the Table

Outcome: you can take any row of duf's output and say exactly what each number is — and why it does not quite match the number df gave you for the same filesystem. This is the chapter that keeps a friendlier tool from quietly changing the facts.

The seven columns

MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM
  • MOUNTED ON — the mount point: where this filesystem appears in the tree of files.
  • SIZE — the filesystem's total capacity.
  • USED — space currently holding data.
  • AVAIL — space still available to an ordinary user. This is the number to watch: it already excludes any blocks the filesystem reserves for the administrator.
  • USE% — used as a percentage of size, with the bar described below.
  • TYPE — the filesystem type: btrfs, tmpfs, overlay, ext4, and their kin.
  • FILESYSTEM — the device behind the mount: a disk device such as /dev/mapper/rv, or the type name again for memory filesystems.

The bar

USE% carries a small bar of block characters that fills as the filesystem fills — at 18.0% the lab's home filesystem drew three full blocks and a partial one (███▌); at 0.1% the bar is, honestly, invisible. On a real terminal the bar is coloured: green while fullness is under the first threshold, yellow past it, red past the second (the thresholds default to 0.5 and 0.9 and are chapter 10's topic). The AVAIL column is coloured on the same idea, from the other direction — yellow when less than 10G remains, red below 1G, by default.

Two honest notes about the bar. First, it is the first thing the renderer sacrifices: squeeze the table — a full seven-column table in an 80-column terminal — and the bar disappears entirely, leaving the percentage. The lab's fullest captures have no bars for exactly this reason. Second, the lab's terminal was a capture pipe, and its captures prove the bar and its colour codes are emitted — they do not let this guide grade the colours, which chapter 10 and criteria.md treat as documented-only.

Sizes, and the rounding you can trust

Duf prints sizes in binary units (1G = 1024 × 1024 × 1024 bytes) with one decimal place: 200.0G, 163.3G, 512.0M. Df's -h prints whole numbers: 200G, 164G. Same filesystem, same moment, two presentations — df rounds its display up, duf shows a decimal. A difference of a unit in the last place between the two tools is rounding, not disagreement.

Percentages are computed differently

This one is not rounding. For the lab's home filesystem the two tools printed:

duf:  200.0G size, 36.0G used, 163.3G avail  →  18.0%
df:   200G size, 37G used, 164G avail       →  19%

Duf's USE% is used ÷ size, as a decimal: 36.0 ÷ 200.0 = 18.0%. Df's Use% is used ÷ (used + avail), rounded up to the next whole percent — the traditional Unix formula, which answers "of the space I may use, how much is gone?" rather than "of the whole disk, how much is gone?". On filesystems with reserved blocks the two formulas genuinely diverge, and df will look slightly more alarmed. Both are defensible; they are not interchangeable, and a threshold you set in one tool ("page me at 90%") means something slightly different in the other. Chapter 9 shows the figures underneath both — in bytes, from duf's JSON, df and duf agreed exactly.