Best way to clear inodes?

October 18, 2014 1.4k views

I have run out of inodes! I have a folder with millions of smaller files that I would like to keep. However, using df -i I see that I am 100% out of inode space. Can I just clear them? It appears I need to do something since I can't even download the files through scp or sftp in order to clear them from my remote server.

Ideas? Suggestions?

1 Answer

An inode is allocated at the file level so it's quite possible to run out of inodes long before you run out of disk if you have millions of smaller files. If you are completely out of inodes, you'll have to delete what you can. You'll probably want to reboot in order to make sure there aren't any processes holding onto the files in memory.

Obviously, this isn't a long term solution. You'll probably need to either use a bigger droplet or look into using and external storage component that you can mount as a network file system.

Have another answer? Share your knowledge.