Linux – 100 % inodes in root directory, how to free inodes

inodelinuxubuntu-12.04

df -i
Filesystem-----Inodes-----Iused-----IFree-----IUse-----Mounted on
dev/sda2-------732960-----727804-----5156-----100%---- /

Only these 2 are having higest inodes, rest all are too low. what can be done to free up inodes?

Proc 10937 inodes

Sys 22504 inodes

apt-get -f install says no space left

df -i output image

enter image description here

apt-get -f install output error image

enter image description here

inodes search output image –

enter image description here

var log is only 26Mb (highest in var directory)

Best Answer

I was experiment the same issue some weeks ago, and this procedure was solve the problem.

First, search where is the most space use

    for i in /*; do echo $i; find $i |wc -l; done

Pay attention when some directories take more time to be readed. In my case was the /var/ where take more time searching.

So run that:

    for i in /var/*; do echo $i; find $i |wc -l; done

After that, run the same command to /var/log/* and detect a lot small files on the squid3 logs.

After run an rm -rfv /var/log/squid3/access.log* (and restart squid3) the problem was solved, and the IUSE% change from 100 to 13.

Regards.