Stop getting lied to by df and du

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

Stop getting lied to by df and du

🧩 The Challenge

You ever deleted a massive log file to clear up space, only for your monitoring alerts to keep screaming that the disk is full? I’ve spent way too many nights hunting for space that supposedly doesn’t exist because some process still has the file handle open.

💡 The Fix

Use lsof to find those hidden zombies holding onto deleted files and restart the offending process to reclaim the blocks. It’s the only way to make the filesystem actually acknowledge the space is free again.

lsof +L1 /var/log/

⚙️ Why It Works

Processes don’t actually let go of disk sectors until they close the file descriptor, even if you’ve unlinked the file from the directory tree. This command specifically filters for open files that have a link count of zero.

🚀 Pro-Tip: If you’re scared of killing a production service, you can often just truncate the file handle by redirecting null into the proc file descriptor instead of a full restart.

Linux Tips & Tricks | © ngelinux.com | 7/17/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted