Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop pretending your disk space is missing when files are open
đź§© The Challenge
You finally clear out a massive pile of old logs to fix a disk full error, but df still says the drive is at 100% capacity. It makes you feel like you’re losing your mind because du shows a completely different size than your filesystem reporter.
đź’ˇ The Fix
The problem is almost always a process holding a deleted file open, meaning the kernel hasn’t reclaimed the space yet. You just need to find the zombie file descriptor and kill the process holding onto it.
lsof +L1
⚙️ Why It Works
This command scans your file system for files that have a link count of zero but are still being held open by a process ID. Once you restart the offending service, the kernel finally lets go and your disk space magically reappears.
🚀 Pro-Tip: If the process is something critical you can’t restart, just empty the file by echoing nothing into it via /proc/<pid>/fd/<fd_number> to shrink it without killing the app.
Linux Tips & Tricks | © ngelinux.com | 10/11/2026
