Monitoring Disk Space

The one system resource that is most commonly over-committed is disk space. There are many reasons for this, ranging from applications not cleaning up after themselves, to software upgrades becoming larger and larger, to users that refuse to delete old email messages.

No matter what the reason, system administrators must monitor disk space usage on an ongoing basis, or face possible system outages and unhappy users. In this section, we will look at some ways of keeping track of disk space.

Using df

The easiest way to see how much free disk space is available on a system is to use the df command. Here is an example of df in action:

Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda3              8428196   4282228   3717836  54% /
/dev/sda1               124427     18815     99188  16% /boot
/dev/sda4              8428196   3801644   4198420  48% /home
none                    644600         0    644600   0% /dev/shm

As we can see, df lists every mounted file system, and provides information such as device size (under the 1k-blocks column), as well as the space used and still available. However, the easiest thing to do is to simply scan the Use% column for any numbers nearing 100%.