Site icon New Generation Enterprise Linux

Stop your files from staying alive after you delete them

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

Stop your files from staying alive after you delete them

🧩 The Challenge

You finally clear out a massive log folder to free up space, check df, and notice the partition is still screaming at 99 percent capacity. I have wasted way too many hours chasing phantom usage because a process is still holding onto that deleted file handle.

💡 The Fix

Find the processes that are clinging to those deleted files so you can restart them and actually reclaim the blocks. It is the only way to make the filesystem realize the space is truly gone.

lsof +L1 /var/log/

⚙️ Why It Works

Since the kernel keeps the file open even if the directory entry is gone, lsof identifies the specific process ID that needs a poke. Once that process gets a restart signal, the link count finally hits zero and the disk space reflects your cleanup work.

🚀 Pro-Tip: If you can’t restart the service, try truncating the file with a shell redirect instead of rm.

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

0 0 votes
Article Rating
Exit mobile version