Where is all the Disk Space?
search cancel

Where is all the Disk Space?

book

Article ID: 295175

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

This article describes about the disk space in Greenplum.

 


Resolution

If there is need to find out where is the disk space allocated, the du/df commands can be used.

  • df -h -> show disk used/free disk space per mount point
  • du -> show used space per directory

A handy command to find out which directory contains the biggest files is the following:

DIR="/data/lubo/42/gpseg0/base"; du -sb `find $DIR -type d` | sort -n

This will find the space usage for all directories under the specified directory (space usage is cumulative) and then sort the directories by used space. Based on the output it is easy to track where are the big files.

Note: Keep in mind that in Linux/Unix deleting a file does not release the free space until all the processes that have opened this file have either closed the file or exited. This means that if you delete a huge log file, it will not show in the directory listing, but space will not be released until the program that has it opened closes it. You can see if there are such files by using "lsof" - deleted files will be marked as (deleted). The following command will show the space used by deleted files:

lsof | awk '/deleted/ {sum+=$7} END {print sum}'

Additional Information

+ Environment:

Pivotal Greenplum Database (GPDB) all versions