Finding Large Files on 1 Partition
This week my main file server hit 100% utilization on the main, /, partition. Normally, only 4GB or so is used on the 20GB partition. Something was wrong.
To find big files on just the root partition, use:
sudo find / -type f -size +200M -xdev
The -xdev switch tells find
to stay on the same partition, so mount points under /, like /mnt or /export will not be considered.
Very handy when your HDD says 100% utilization. Starting with 200M, should remove almost all OS files. I had to drop to 100M to see just 3 files on / before finding the storage eating issue.
Root Cause
In my situation the root cause was a backup partition that wasn’t mounted after a reboot, so when the backups ran, they used all the available storage under /. Not good.
Anyway, find has lots of options, more than most of us can remember. Checking the man page was necessary. Other options like this are those that follow symlinks or not and there’s a way to limit the depth of the directory structure followed down.