EASILY DETERMINE DISK USAGE

Disk free (df) is a useful Linux tool for determining disk usage. Typically, df is invoked with no options; however, this returns an unreadable format in bytes of free and used space. There are a few options that you can use to make the output more readable and meaningful.

The first option is the "-h" option, which tells df to use a human-readable format. It displays sizes, not in bytes but in Kilobytes, Megabytes, and Gigabytes.

The "-i" option displays inode information instead of bytes. This is useful if you suspect that your file system is running out of inodes. You may still have room on your drive, but without inodes, you will be unable to use the remaining space. (A symptom of this is using many small files, each with it's own inode.)

The "-l" option displays only local filesystems, not remote-mounted filesystems such as NFS or Samba volumes.

The "-T" option displays the type of filesystem. This tells you if a particular filesystem is ext2, reiserfs, NFS, etc.

Take a look at the following example:

# df -h -T -l

Filesystem Type Size Used Avail Use% Mounted on

/dev/hde1 reiserfs 3.9G 2.4G 1.5G 60% /

/dev/hde5 reiserfs 3.9G 2.5G 1.4G 62% /home

/dev/hdh1 reiserfs 57G 31G 26G 54% /mp3

/dev/hdf3 reiserfs 18G 1.6G 16G 9% /usr/local

/dev/hde2 ext2 984M 119M 815M 13% /var

none tmpfs 376M 0 376M 0% /dev/shm


Here you can see the size of each filesystem, the amount used, and the amount available. You can also see where it is mounted and what type of filesystem it is.