What Duf Is
A disk fills up. It never announces
the moment; one day a download fails,
a database stops, a backup quietly
writes nothing. The defence is asking,
now and then: how much room is left
on this machine? Unix has answered
that question since the beginning with
df — disk free — and df's answer is
correct, complete, and nearly
unreadable: a grid of nine-digit
numbers in a unit it chooses for you,
with your real disks mixed into a
crowd of mounts you never asked about.
Duf is that same answer, presented
for humans. It is a small program —
one binary file — that asks the
operating system about every mounted
filesystem (every storage area
currently attached to the machine, be
it a disk, a partition, or a patch of
memory pretending to be one), and
prints what it learns as a set of
tables: one for your local disks, one
for network mounts, one for the
system's own special filesystems.
Sizes come out in friendly units with
one decimal place — 163.3G, not
171353464832 — and each row carries
a small bar that fills as the
filesystem fills, so the fullest disk
on the machine is visible before you
have read a single number.
Nothing about the facts changes. Duf asks the kernel the same question df asks, through the same system call, and chapter 9 of this guide checks the two tools against each other in bytes: on the lab machine their figures for the root filesystem were identical. What duf changes is everything around the facts — the grouping, the sorting, the units, the filtering, and one more thing df never offered: the whole inventory as JSON, ready for scripts.
A first taste
After installing (chapter 3), asking is one word:
duf
and the answer begins like this (the lab machine's own crowded table, trimmed here):
╭──────────────────────────────────────────╮
│ 19 local devices │
├────────────────┬────────┬───────┬────────┤
│ MOUNTED ON │ SIZE │ USED │ AVAIL │
├────────────────┼────────┼───────┼────────┤
│ /home/hatch │ 200.0G │ 36.0G │ 163.3G │
One filesystem you may actually care about, in numbers a person can hold in their head. Chapter 4 puts this beside df's answer to the same question and takes the table apart.
The line duf draws, stated early
Duf is a read-only reporter. It reads your machine's mount table, asks each filesystem its size, and prints. It writes nothing, changes nothing, mounts nothing, and sends nothing anywhere — there is no network in it at all. It also needs no special permission: everything it shows is information any program on the machine can ask for. The one caution worth stating before any procedure: its output is a map of the machine — mount names, filesystem types, sizes. That map is about your machine, so run duf on machines that are yours to inspect, and treat screenshots of its output the way you would treat any inventory of your own systems.
What it is not
Duf is not a disk usage tool in the "what ate my disk" sense: it reports whole filesystems, never the folders inside them — that is the dust and ncdu question (chapter 12). It is not a partitioner or a repair tool: it cannot create, resize, mount or fix anything. It is not a monitor: it takes one snapshot per run and keeps no history, raises no alerts, and draws no graphs over time. And it is not more accurate than df — chapter 5 shows the two rounding the same facts differently, which is a presentation choice, not a correction.
Who it is for
The person with three machines and a
nagging feeling about one of them. The
homelab keeper whose media disk fills
a little every week. The developer
mid-incident, asking "is it the disk?"
and wanting the answer in two seconds,
grouped and sorted, not after decoding
df. The script writer who wants the
facts as JSON rather than as columns
to be cut apart with awk. The common
thread is one question — how much
room is left, everywhere, right now?
— asked of a machine you look after.