How do I check disk usage on my Linux server?

View a step-by-step screencast of this process:

Log into the RHEL server as root via PuTTY, or shell out from Eterm.

The “df” command is used to determine overall filesystem usage. The “vgs” command will show you any space available in the volume group that has not yet been allocated to a specific filesystem.

To see the total size of each filesystem:

df -h

The standard Eclipse filesystems are located under /u2. Add the “Used” column for each of these filesystems, plus any non-standard Eclipse filesystems that you may have (/train, /backup, etc.).

[root@firestorm ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-root
                       20G   18G  1.1G  95% /
/dev/mapper/datavg-u2
                      3.9G  2.1G  1.6G  57% /u2
/dev/mapper/datavg-uvtmp
                      3.9G  137M  3.6G   4% /u2/uvtmp
/dev/mapper/rootvg-esupport
                      5.9G  3.4G  2.3G  60% /esupport
/dev/sda1              99M   26M   69M  28% /boot
tmpfs                 3.9G     0  3.9G   0% /dev/shm
/dev/mapper/datavg-eclipse
                       26G   17G  7.6G  69% /u2/eclipse
/dev/mapper/datavg-ereports
                      992M   34M  908M   4% /u2/eclipse/ereports
/dev/mapper/datavg-lvol0
                      3.9G  2.1G  1.6G  57% /snap/u2
/dev/mapper/datavg-lvol4
                      3.9G  137M  3.6G   4% /snap/u2/uvtmp
/dev/mapper/datavg-lvol6
                       26G   17G  7.6G  69% /snap/u2/eclipse

If you would like to identify which files or subdirectories are using the most space in a particular filesystem or directory, you may use the “du” command. For example, to list the disk usage of top files and directories under /u2/eclipse in megabytes:

[root@firestorm ~]# cd /u2/eclipse
[root@firestorm eclipse]# du -sm * | sort -rn | head
3780    modules-linux
2856    modules
1568    ZIP4
859     jsdata
740     PHANTOM.LOG
740     modules-test
450     8.6.9.00.16-aix.zip
447     8.6.9.00.99-aix.zip
446     8.6.9.00.11-aix.zip
428     8.6.9.00.13-aix.zip

If you would like to see how much space is available for allocation within the volume group:

vgs

For more detail on this process, see: How do I expand a Linux file system?

Alternatively, if you prefer a graphical tool, you may log into the server’s GUI, and use the Disk Usage Analyzer tool:

  • Log into the server’s GUI (see also How do I access the GUI of my Linux server?)
  • Applications -> System Tools -> Disk Usage Analyzer
  • Click the Filesystem button to begin storage analysis of your entire system
  • Use the controls to drill down into each subdirectory for a graphical picture of storage utilization