X
X

Select Your Currency

Türk Lirası $ US Dollar
X
X

Select Your Currency

Türk Lirası $ US Dollar

Linux Servers Disk Full (No Space Left) Problem Solution

HomepageArticlesLinux Servers Disk Full (No Space Left) Proble...

What Causes the "No Space Left on Device" Error?

The "No Space Left on Device" error, which causes your database to crash, your website not to open, and even prevents you from establishing an SSH connection, is a problem frequently encountered by virtual server (VDS) administrators. This situation is caused either by your disk being completely full (in megabytes) or by reaching the Inode (file number limit) limit.

1. Check Disk and Inode Usage

In an SSH terminal you can connect to, enter the following command to see the overall disk capacity:

df -h

If the capacity (Use%) shows 100% in the results, your space is full. However, even if the capacity is not full, your file count may have hit the limits (Inode fullness). To see this:

df -i

If Inode is 100%, it means you have millions of unnecessary small files (e.g., session files) on your server and the creation of a new file is not allowed.

2. Finding Large Sized Files (e.g., Logs)

The most practical command to see which folders are draining space on your system is the following (It may scan the system for 1-2 minutes):

du -sh /* | sort -hr

Usually, the problem stems from massive log files in /var/log (for example, /var/log/syslog or /var/log/nginx/error.log). You can urgently free up space by deleting these logs:

truncate -s 0 /var/log/nginx/error.log

(Note: Zeroing out the file with truncate instead of deleting it with rm prevents running services from crashing.)

3. Cleaning Cache, Trash, and Temp Files

If you use Ubuntu, to delete unnecessary packages: the commands apt-get autoremove && apt-get clean are very useful. In CentOS, you can do yum clean all. Additionally, it is recommended that users periodically clean the /tmp folder.

If your site's database or media archive is constantly growing, doing cleanups will no longer be a solution. By renting our flexible capacity VDS server packages designed for those whose projects are growing rapidly, you can increase your disk quotas whenever you want with a single click!


Top