BuycPanel Blog

BuycPanel Blog

Latest news and updates

How to Clear a Full Partition in cPanel?

Posted by Allura on 05 11 2019.

Introduction
This script caters to the steps in clearing a full partition. Normally, the /var directory gets filled up at the beginning as it grabs all the documents of the system logs.Because of the Apache, the /usr directory might as well get fill up speedily.Clear A Full Partition
1.    Check Directory Space From The Command Line
To do this,Log in to the server via SSH as the root user.
The user should check his system to find the directory utilizing the maximum space. For checking it, the user has to modify to the /var directory and then run the du -sh command.For the directory, the du utility edits the approximate disk space management of every file.
The -sh argument edits the data in the human-readable form.An output will be shown thereafter.Check the output and analyze the directories using the maximum space.2.    Delete Selected Files And Directories
To do this,Go to…

Introduction

This script caters to the steps in clearing a full partition. Normally, the /var directory gets filled up at the beginning as it grabs all the documents of the system logs.

Because of the Apache, the /usr directory might as well get fill up speedily.

Clear A Full Partition

1.    Check Directory Space From The Command Line

To do this,

  • Log in to the server via SSH as the root user.
  • The user should check his system to find the directory utilizing the maximum space. For checking it, the user has to modify to the /var directory and then run the du -sh command.
    • For the directory, the du utility edits the approximate disk space management of every file.
    • The -sh argument edits the data in the human-readable form.

An output will be shown thereafter.

  • Check the output and analyze the directories using the maximum space.

2.    Delete Selected Files And Directories

To do this,

  • Go to the directories taking maximum disk space.
  • Run the du -h * command to analyze the capacity of each file.
  • Next user can delete the files or he can recover the recent entries.
    • Use this command to save the entries:

tail -5000 filename > filename.new

mv filename.new filename

sync

Here, filename refers to the file that is to be removed, filename.new refers to the file that will have the recent entries.

  • Use the command for deleting the desired files:

cat /dev/null > filename

3.    Restart the Service

To do this,

The user has to pursue the directions mentioned in our How to Restart Services documentation.

Conclusion

All data regarding full partition in cPanel is reviewed in this article.