Sometimes, we face the issue of server usage reaching to 100% of the server space. However, in reality the application might not be using that much server space.
In order to solve this issue, here, we have listed some steps for you to find the directory usage and remove the unnecessary files:
1. Login to server using your ssh details using putty or command line:
ssh <username>@<host>
In the next step, enter your password.
2. Run the df
command to find out information about the total space and available space on the file system including partitions:
df -h
3. As you can see in the above image, the above command is showing that server is using only 28% of the total space. Even then, we are getting error “No space left on device”. So, now we need to check whether server is running out of inodes or not?
4. Sometimes, df
command reports that there is enough free space but system claims that the file-system is full. We need to check for the inode which will identify the file and its attributes on the file system using the following command:
df -i
Find unwanted large files and delete them.
Now we need to find directory wise usage in ubuntu. We need to install NCurses Disk Usage.
sudo apt-get install ncdu
Now we will use the following command to check directory usage:
sudo ncdu /
In our case, the tmp/cache
contains unnecessary temporary files. So we need to delete them.
Navigate to the directory you want to empty.
sudo rm -rf /tmp/cache/*
Here, in our case we would empty the cache folder.
Now again use to df -i
to check if the space is released by removing cache directory files or not.