Site icon New Generation Enterprise Linux

Stop invisible space leaks when files are still held open

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

Stop invisible space leaks when files are still held open

đź§© The Challenge

You know that feeling when df shows your partition is 100% full, but running du on the root directory tells you otherwise? It’s enough to make you pull your hair out because you can’t actually find the files eating the space.

đź’ˇ The Fix

The culprit is almost always a deleted file that a running process still has a file handle on, which means the space isn’t actually freed until you restart the process.

lsof +L1

⚙️ Why It Works

Adding that +L1 flag tells the system to only list files that have a link count of zero, effectively hunting down those ghosts that are clogging up your disk but are hidden from standard directory listings.

🚀 Pro-Tip: If you can’t restart the service, try truncating the file to zero length by redirecting null into the proc file descriptor instead.

Linux Tips & Tricks | © ngelinux.com | 7/22/2026

0 0 votes
Article Rating
Exit mobile version