Site icon New Generation Enterprise Linux

Stop df from lying to you about your disk space

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

Stop df from lying to you about your disk space

đź§© The Challenge

You ever look at a server that says the partition is full, but when you run du on the root directory, the numbers don’t even come close to adding up? It’s enough to make you pull your hair out because you can’t find the space you’re supposedly using.

đź’ˇ The Fix

Someone probably deleted a large log file while an application was still keeping an open handle to it. You just need to find those specific ghosts and restart the service holding onto them.

lsof +L1 /var/log/

⚙️ Why It Works

The kernel keeps the file data on disk until the last process closes its reference to it, which is why df sees the space as gone even though the file is unlinked. Listing open files with at least one link count of zero reveals the culprit immediately.

🚀 Pro-Tip: If you don’t want to restart the service, just truncate the file in place with a redirect to keep the file descriptor valid but empty.

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

0 0 votes
Article Rating
Exit mobile version