Site icon New Generation Enterprise Linux

Why your disk usage numbers never add up

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

Why your disk usage numbers never add up

🧩 The Challenge

Ever run du on a mount point and compare it to df, only to see a massive gap that makes you question your sanity? I’ve spent whole afternoons hunting for missing gigabytes that turned out to be open file descriptors holding onto deleted data.

💡 The Fix

Use lsof to see which processes are keeping deleted files alive on your disk, otherwise they stay invisible to du but keep taking up your partition space.

/usr/sbin/lsof +L1

⚙️ Why It Works

Deleted files are invisible to the directory tree but the kernel keeps them open as long as at least one process has a handle on them. Once you restart the specific process holding those deleted inodes, the disk space actually clears up.

🚀 Pro-Tip: If you’re on a busy server, pipe that to grep deleted to quickly spot the real offenders.

Linux Tips & Tricks | © ngelinux.com | 9/16/2026

0 0 votes
Article Rating
Exit mobile version