Stop relying on df to tell you the truth about deleted files

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

Stop relying on df to tell you the truth about deleted files

🧩 The Challenge

Ever deleted a massive log file to clear up space, only to find df still reports the disk as completely full? I’ve spent way too long staring at a 100% full partition wondering if my hardware was hallucinating.

💡 The Fix

The process that opened the file is still holding onto the file descriptor, so the filesystem can’t actually release the blocks until the process closes them or you kill it. You just need to find those specific ghosts and restart the service holding them hostage.

lsof +L1

⚙️ Why It Works

Since the file has been unlinked but a process is still talking to it, it won’t show up in a standard directory listing, but lsof can peek at the open file descriptors that have a link count of zero.

🚀 Pro-Tip: Just piping that to awk ‘NR>1 {print $2}’ | xargs kill -9 is the quickest way to force the space back, but maybe check which service it is first unless you want to break production.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted