Knowledgebase

How do I fix disk space issues on my Server? Print

  • 0

How do I fix disk space issues on my Rcs.is?

When the space on the Rcs.is’s disk is full, it can interfere with the Rcs.is’s functionality, such as causing database write issues, being unable to view application logs, Rcs.is resizing problems, and being unable to reset the Rcs.is’s root password. Clearing space on the Rcs.is’s hard disk will allow the Rcs.is to function normally.

To fix the problem, access the Rcs.is via SSH or log in using the Recovery Console.

You can check which folders are using the most space on the Rcs.is by using the disk utilization command, du:

du -h --max-depth=1 /var

The command returns output similar to this:

4.0K	/var/local
4.0K	/var/opt
91M	/var/cache
4.0K	/var/mail
623M	/var/lib
214M	/var/log
4.0K	/var/crash
28K	/var/spool
1.6M	/var/backups
60K	/var/snap
36K	/var/tmp
930M	/var

In this example, the command lists the directories in the /var directory and how much space they are using. The -h flag returns the output in a human-readable format, and the --max-depth=1 flag outputs the disk usage only for the folders in the /vars directory. Increasing the value of --max-depth returns additional levels of subfolders. You can use the du command to assess other directories and sub-directories by changing the path in the command.

Once you see which directories have high utilization, you can use the list command, ls, with the -larSh flag to see which individual files are largest in the directory:

ls -larSh /var/log/

In the example above, this returns all of the files in /var/log directory, sorted by size, in human-readable format.

Rapid increases in disk utilization are commonly caused by system or application log files being filled with errant entries in the /var directory. When clearing out hard disk space on your Rcs.iss, we suggest you start by assessing the space usage of files in the /var directory. The /var directory also commonly houses website and database files making it a prime location for high disk utilization.

Based on the output, you can start deleting unwanted files. To delete a file, use the rm command:

rm your-file-name

To remove a directory, use the rm command with the directory flag (-d):

rm -d your-directory-name

After deleting old files, unwanted programs, log rotations, and removing extra packages, run the disk free command (df) with the human-readable format (-h) flag to verify that the disk space has been reduced:

df -h

The command returns output similar to this:

Filesystem      Size  Used Avail Use% Mounted on
udev            474M     0  474M   0% /dev
tmpfs            99M  960K   98M   1% /run
/dev/vda1        25G  2.5G   22G  11% /
tmpfs           491M     0  491M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           491M     0  491M   0% /sys/fs/cgroup
...

The output displays the size of each file system on the Rcs.is, the space used in each file system, and how much space is available. The /dev/vda1 represents your Rcs.is’s hard disk space.


Was this answer helpful?
Back

Powered by WHMCompleteSolution