Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop hunting for ghost space when your filesystem is full
🧩 The Challenge
You know that feeling when df shows a disk is 100% full, but you run du on the root directory and the numbers don’t add up? I’ve spent an entire afternoon once tracking down a deleted log file that a background process was still holding open.
💡 The Fix
Just use lsof to check for deleted files that are still hogging the blocks. It’ll show you exactly which process is keeping that storage hostage so you can restart it and reclaim the space without a reboot.
lsof +L1
⚙️ Why It Works
The kernel keeps the file’s data blocks marked as busy until the file descriptor is closed by the process, even if the filename is gone from the directory entry. This command specifically filters for files that have a link count of zero but are still open.
🚀 Pro-Tip: Always pipe that into awk to grab the PID and just kill -HUP the process to release the file handles without dropping the service connection.
Linux Tips & Tricks | © ngelinux.com | 8/28/2026
