Why cloud instance is Out Of disk space

There are several common reasons why your Instance might be running out of disk space. Some of the common reasons are mentioned below.

Log Files

A server log files contain records of all server activities and can provide detailed insights into a website or application access. These files are usually located in the /var/log directory and can grow over time if not purged regularly. You can use services like Logrotate to purge logs or manually truncate them using commands like

cat /dev/null > /var/log/messages

Backup Files

Regular backups stored on your server can increase disk consumption. Make sure to have a system in place for deleting old backups.

Temporary Files and Regular Uploads

Some applications and services may create temporary files in the /var/tmp folder. Check these files and clear them if not needed. Also, check for regular uploads of files and folders that may no longer be needed but still consume disk space.

Identify the Disk Usage on your Serve

In order to identify the Disk Usage on your Serve you may use the command to check wich partition is full.

df -h

Further, you can identify further. For example, To check the Disk usage of the path /root/neev you can use the below command

du -sh /root/neev/*

It will List the files consumption something like this:

15GB         /root/neev/backup_file
518MB        /root/neev/trial
10MB         /root/neev/temp_folder

As an alternative to identify the full Disk Usage on your server, you may use (NCurses Disk Usage) ncdu CLI which is a command-line version of the most popular “du command“. Based on ncurses, it offers a quick method for analyzing and monitoring the files and directories that are consuming disk space in Linux.

To run the command ncdu in your Linux distro you may use the following command

For RHEL, CentOS

yum install ncdu

For Ubuntu and Debian

sudo apt-get install ncdu

Once the installation is complete you can now run the command ncdu in the terminal / CLI.

ncdu /

Sometimes, unknown space consumption may occur when programs write to deleted files. You can use the command below to find such files.

lsof | grep “(deleted)”

Also, rebooting your instance may also fix this issue.

Last updated