Stop mystery disk space vanishes when your logs are supposedly tiny

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

Stop mystery disk space vanishes when your logs are supposedly tiny

🧩 The Challenge

Ever had a server complain it’s out of disk space, but when you run du it says you’re using barely anything? I’ve wasted an entire afternoon once tracking down a rogue process that had an massive log file open, deleted the file, but kept the file descriptor active so the space never actually reclaimed.

💡 The Fix

Use lsof to see which processes are hanging onto deleted files that are still sucking up your inodes and hidden blocks. You’ll need to restart the services holding these files to actually free up the space.

sudo lsof +L1

⚙️ Why It Works

Adding the +L1 flag tells the system to only list open files that have a link count of less than one, which is exactly how deleted files hide from your normal view. It forces the kernel to cough up the truth about what is actually eating your storage.

🚀 Pro-Tip: If a service is critical and you can’t restart it, just truncate the file by echoing nothing into the file descriptor directly in /proc/PID/fd/.

Linux Tips & Tricks | © ngelinux.com | 8/25/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted