Stop hunting for ghost space when df and du refuse to agree

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

Stop hunting for ghost space when df and du refuse to agree

🧩 The Challenge

You look at df and see the disk is 90 percent full, but running du on the root directory tells you most of that space is just… gone. It’s usually a process holding onto a massive deleted file, and finding which one is a headache.

💡 The Fix

Use lsof to track down the hidden culprits that are keeping space tied up after a file was unlinked. It’s the only way to see what the kernel is actually keeping open behind your back.

sudo lsof +L1 /

⚙️ Why It Works

Adding the +L1 flag tells lsof to specifically list files that have a link count of zero but are still held open by a process. Once you find the PID of the offending service, a quick restart usually clears the space immediately.

🚀 Pro-Tip: If you can’t restart the service, try truncating the file by echoing nothing into the file descriptor in /proc/[pid]/fd/[number].

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted