Skip to content

Your First Run

Outcome: a full inventory of the machine's filesystems, grouped and readable — and an honest look at how it differs from what df has been showing you. Everything here is the default view: no flags yet except the ones that ask about a single place.

The default view

./duf

Duf prints one table per group (chapter 2). On the lab machine the run produced two tables — 19 local devices and 34 special devices — because that machine has no network filesystems. A row looks like this:

│ /home/hatch    │ 200.0G │ 36.0G │ 163.3G │  18.0% │ btrfs   │ /dev/mapper/rv │

Read it left to right: the mount point, the filesystem's size, how much is used, how much is available, the percentage used, the filesystem type, and the device behind it. The tables are sorted by mount point, and long names wrap onto a second line rather than being cut off.

The same question through df

Beside it, the lab ran the command duf replaces (transcript t01):

df -h

Df answered in 11 rows; duf's default view showed 53. Neither is wrong — they draw the line in different places. Df shows one row per device per mount it considers reportable and collapses the rest; duf's default shows every mount its filter lets through, including the same device mounted at several places (the lab's home filesystem genuinely appears twice in duf's table, because it is mounted twice). And the crowd differs in the other direction too: duf's default view left out 23 of the kernel's 76 mounts entirely — among them, on this machine, the root filesystem itself. Chapter 7 is about that filter; for now, hold the shape of the idea: duf's table is an edited view of the mount list, and --all shows the unedited one.

Asking about one place

Duf accepts paths as arguments and answers for the filesystem each path lives on:

./duf /tmp
│ /tmp │ 512.0M │ 420.0K │ 511.6M │ 0.1% │ tmpfs │ tmpfs │

Several paths can be asked at once (./duf /home/hatch /tmp). Two warnings from the lab's transcripts belong here rather than in fine print. First, the argument must exist: a path that does not exist is an error with exit code 1. Second — the trap chapter 14 returns to — a path whose filesystem the default filter has tidied away gets no answer at all: on the lab machine ./duf / printed nothing and exited successfully, because the root mount was among the filtered. When a path you know exists returns silence, add --all before you conclude anything:

./duf --all /
│ / │ 7.5G │ 2.4G │ 4.9G │ 32.6% │ overlay │ overlay │

The check for this chapter

Run df -h and duf side by side and find your root filesystem in both. If duf's default view has it, your machine's mounts are tidier than the lab's. If it does not, you have already met the filter — and you know the two commands (--all, and --json in chapter 9) that always show the whole list.