Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop thinking your disk is full when deleted files are still holding space
🧩 The Challenge
Ever run df -h, see the disk is pegged at 100 percent, delete a massive log file, but the space just never comes back? It drives me nuts because the kernel keeps the file descriptors open until the processes are poked.
💡 The Fix
Use lsof to spot those ghost files that are deleted but still taking up space on your mount point. You just need to kill or restart the service to actually reclaim the blocks.
lsof /path/to/mount | grep deleted
⚙️ Why It Works
Because Linux doesn’t immediately release the disk space while a process still has a handle on the inode, you have to find the specific PID that is hanging onto the data.
🚀 Pro-Tip: If you don’t want to kill the app, you can often truncate the file descriptor directly in /proc/[pid]/fd/ to free the space without crashing the process.
Linux Tips & Tricks | © ngelinux.com | 10/31/2026
