Stop invisible space leaks when files are still held open
Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop invisible space leaks when files are still held open
🧩 The Challenge
You know that feeling when df shows your partition is 100% full, but running du on the root directory tells you otherwise? It’s enough to make you pull your hair out because you can’t actually find the files eating the space.
💡 The Fix
The culprit is almost always a deleted file that a running process still has a file handle on, which means the space isn’t actually freed until you restart the process.
lsof +L1
⚙️ Why It Works
Adding that +L1 flag tells the system to only list files that have a link count of zero, effectively hunting down those ghosts that are clogging up your disk but are hidden from standard directory listings.
🚀 Pro-Tip: If you can’t restart the service, try truncating the file to zero length by redirecting null into the proc file descriptor instead.
Linux Tips & Tricks | © ngelinux.com | 7/22/2026
