This document provides the steps to clear a full partition. Usually, the
/var directory fills up first, because it holds all of the system logs.
/usr directory may also fill up quickly due to Apache.
Clear a full partition
Check the directory space from the command line.
To check the disk space from the command line, perform the following steps:
Log in to your server as the
rootuser via SSH.
Examine your system to locate the directory or log that uses the most space. To do this, change to the
/vardirectory and run the
duutility prints the estimated disk space usage of each file and directory for the path that you specified.
-shargument causes the command to print the information in a human-readable format.
The output will resemble the following example:Click to view...
The numbers in the left column of the output represent the file size of each file and directory that the specified directory path contains, in human-readable format.
Due to the number of files and directories in the
/vardirectory, this example only shows partial output from the
- Examine the output and determine which directories use the most space.
Delete selected files and directories.
You can delete individual files within a directory and individual directories. To do this, perform the following steps:
- Change to the directories that contain the most disk space.
Examine the size of each file in the directory. To do this, run the
du -h *command.
The output will resemble the following example:
The following example displays the output for the
- Either delete the files or save the most recent entries.
To save the most recent entries, run the following commands:
In these commands,
filenamerepresents the file to delete, and
filename.newrepresents the file to which to save the most recent entries.
To delete the files, run the following command: