Today, I ran out of inodes on one of my VPSs.
I deleted a bunch of superfluous small files, freeing enough inodes to make the system operational again:
Filesystem Inodes IUsed IFree IUse% Mounted on /dev/simfs 586K 529K 58K 91% /
I also hacked together a short command to give me the number of used inodes (essentially listing all files with their inode numbers, filtering out duplicates and counting the lines of the result):
sudo find / -xdev -type f -printf '%i~%P\n' > files.txt <files.txt | sort -u -t'~' -k1,1 > inodes.txt wc -l files.txt inodes.txt
1513608 files.txt 275320 inodes.txt
So it looks like the files on
/ only account for 275k inodes, but
df reports 529k used.
How can that be?
(I even restarted the system to free any inodes that were still locked by processes, but that didn't change the amount of used inodes at all.)