Stop guessing why your filesystems are reporting different sizes
Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop guessing why your filesystems are reporting different sizes
🧩 The Challenge
You stare at df output showing a partition is nearly full, but then you run du on the mount point and the math just doesn’t add up. It’s infuriating when you have gigabytes of ghost files lurking in an open file handle that the kernel won’t release.
💡 The Fix
Use lsof to hunt down the processes holding deleted files hostage so you can actually reclaim that space without a service restart. Getting these handles closed is usually the only way to get your df and du numbers to shake hands again.
lsof +L1 /mount/point | awk '{print $2, $7, $9}'
⚙️ Why It Works
Adding the +L1 flag tells the system to only show files with a link count of zero, which are exactly the ones haunting your disk metrics. Once you see the PIDs associated with those deleted files, you can restart the services holding them to free the blocks.
🚀 Pro-Tip: Always check your log rotation settings for those specific services afterward or you’ll be back in this exact same spot next week.
Linux Tips & Tricks | © ngelinux.com | 10/24/2026
