Catch the hidden space thieves with lsof

Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)

Catch the hidden space thieves with lsof

🧩 The Challenge

Ever run df -h and see a disk is 100% full, but when you go digging with du, the directories look mostly empty? It’s the classic case of a deleted file still being held open by some zombie process, and it drives me absolutely insane.

💡 The Fix

Use lsof to see which process is still clinging to the deleted data, then either restart the service or send it a signal to let go.

sudo lsof +L1

⚙️ Why It Works

Adding that +L1 flag tells lsof to specifically list files that have a link count of zero but are still being kept alive in memory. Processes will keep reading and writing to these ghosts until they are finally closed, which is why your disk space doesn’t actually free up when you run rm.

🚀 Pro-Tip: If you don’t want to restart the whole daemon, sometimes just truncating the file in /proc will force the app to reset its handle.

Linux Tips & Tricks | © ngelinux.com | 10/18/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted