Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop df from lying to you about hidden file usage
đź§© The Challenge
Ever stared at a disk that df claims is 90% full, but you’ve run du on every directory and can’t account for more than half of it? I spent half a Saturday on this once before realizing I was staring at ghosts.
đź’ˇ The Fix
The culprit is almost always a deleted file that is still held open by a stubborn process, which keeps the blocks allocated until the service finally lets go. You need to find those invisible zombies and give them the boot.
lsof +L1 /var/log | grep deleted
⚙️ Why It Works
Because Linux doesn’t actually release the disk space until the last file descriptor is closed, that space remains “in use” even if you’ve already run rm. Running this command shows you exactly which process is hanging onto a file you thought you’d already deleted.
🚀 Pro-Tip: Just restart the service holding the file if you aren’t sure how to gracefully close it.
Linux Tips & Tricks | © ngelinux.com | 8/10/2026
