It happens, for one reason or another. As a systems admin you need to find which directories on your server are hogging all of your drive space. One more than one occassion I've seen systems lock up, dynamic websites stop processing session data, and mail systems refusing to de-queue, and the culprit in all of these situations was a full hard disk. So I complied a quick reference of commands that others can use in those situations to ferret out the source fairly quickly.

First I would like to recommend, if you are having strange unexplained issues like the aforementioned, run a quick status on your filesystem diskd to see if drive space is an issue:

# df -h

From here you should be able to see right away if drive space is going to be an issue. Then it's just a simple matter of finding which directories contain the culprits:

# du -h / | grep ^[0-9.]*G


# find / -type d -size +1G

I find that sometimes, the find command works a bit better than du for this, but results may vary depending on the situation. You can also run queries on directories over a certain size (let's say 30 GB for this example) and sort the output with the largest directories on to.

# du -h / | grep ^[3-9][0-9.]*G | sort -rn

There are a number of different combinations you can use, especially if you want to get complicated with the posix expressions in grep.