Scenario
The disk is full and nothing is using it
df says the disk is full. du walks the same directory and finds almost nothing. Get the free space back.
The application stopped taking orders: it writes them into a temporary directory, and large writes fail with "No space left on device". The space keeps shrinking although nobody puts anything there. The on-call engineer checked how much was used, then checked what was using it, and the numbers did not agree.
The symptom
The /tmp filesystem is nearly full. Walking the directory turns up a few kilobytes.
$ df -h /tmp
Filesystem Size Used Avail Use% Mounted on
tmpfs 64M 61M 4.0M 94% /tmp
$ sudo du -sh /tmp
4.0K /tmpBoth commands are telling the truth. They simply count different things, and that is the whole scenario.
What you have to end up with
Three conditions. /tmp has at least 40
Finish this lesson with a free account
This lesson is free once you sign in. Create an account to keep reading and open the lab.
Already have an account? Sign in