Site icon New Generation Enterprise Linux

Stop pulling your hair out when df and du don’t match

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

Stop pulling your hair out when df and du don’t match

🧩 The Challenge

You finally found the directory hogging all your space, deleted the files, and ran df to see the happy news. But the filesystem still reports it’s full, and now you are stuck staring at a screen wondering where the hell the space went.

💡 The Fix

The problem is almost certainly an open file descriptor still holding onto a deleted file that hasn’t been unlinked by the kernel yet. You need to find which process is keeping the ghost alive and kill it or restart the service.

lsof +L1

⚙️ Why It Works

Because the kernel refuses to actually reclaim the inode space until the last process closes the file, simply deleting the file is only half the battle. Listing open files with a link count of less than one shows you exactly which PID is refusing to let go of your disk space.

🚀 Pro-Tip: If you’re on a production box and can’t restart the app, try truncating the file to zero bytes from inside /proc/PID/fd/ instead of killing the process.

Linux Tips & Tricks | © ngelinux.com | 9/29/2026

0 0 votes
Article Rating
Exit mobile version