Stop getting lied to by df when files are deleted but held open

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

Stop getting lied to by df when files are deleted but held open

🧩 The Challenge

You finally clear off those massive log files to save the server from crashing, but df still insists the partition is 100 percent full. It’s infuriating because you know you deleted the data, yet the disk space just won’t come back.

💡 The Fix

The problem is almost always a zombie process holding an open file descriptor to a deleted file. You need to find the specific PID keeping that space hostage so you can kill it or signal it to reopen logs.

lsof +L1

⚙️ Why It Works

This command specifically hunts for files that have a link count of less than one but are still being held open by a process. Once you find the offending PID, you can send it a SIGHUP or just kill the process to reclaim the blocks immediately.

🚀 Pro-Tip: If you don’t want to kill the app, truncate the file descriptor directly using /proc/PID/fd/FILE_DESCRIPTOR to force a zero-byte size without restarting the service.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted