Stop df and du from telling you different lies
Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop df and du from telling you different lies
🧩 The Challenge
You know that feeling when df says your partition is 90 percent full, but du insists the files only take up half that space? I’ve spent hours hunting for phantom files that don’t exist because some runaway log process was still holding onto a deleted handle.
💡 The Fix
Use lsof to find the processes clinging to those deleted files so you can actually free up the space without a reboot. It reveals the hidden bloat that df sees but your folder counts completely ignore.
/usr/sbin/lsof +L1
⚙️ Why It Works
Because Linux doesn’t actually reclaim the disk space until every process closes its file descriptor, those deleted files stay resident in the inode table. Running this shows you exactly which process needs a kick or a restart to let go of the blocks.
🚀 Pro-Tip: Always pipe this into awk if you just want the PIDs to kill the culprit immediately.
Linux Tips & Tricks | © ngelinux.com | 7/23/2026
