Troubleshooting

df shows /var at 100% used, but du -sh /var accounts for far less space. Which cause fits these readings?

Show the answer

Correct answerA. A running process still holds open a file that has been deleted

AWhy this is right: The deleted file has no directory entry for du to find, but its blocks stay allocated until it is closed.

BWhy not this: Running out of inodes shows in df -i; it does not make block usage in df disagree with du.

CWhy not this: df counts allocated blocks, so sparse files make it report less, not their full apparent size.

DWhy not this: du sums file blocks and never counts reserved blocks; df is the one that accounts for reservation.

Space from a deleted file is not freed until every process holding it open closes it or exits. df counts the allocated blocks, while du only walks existing directory entries. lsof +L1 finds such files, and restarting the process frees the space.