Sep 10, 2010

EXT4 inode usage in Linux

I am using Linux (Ubuntu 9.10 Karmic) at my workplace and I have a 80GB SSD drive. So I've used almost the entire disk for the root partition (of 75GB) and formatted into 'etx4' file system. We have a large number of small files in our code path and I have several copies of them. Recently when I updated my code branch I got the folliwing error message:

svn: Can't open file '...somefile...': No space left on device

But I had more than 50% of free space left in my disk. When I checked for the usage of inodes (by "df -i") I found that I have hit the maximum number of inodes limit. For a 75DB ext4 partition, there were about 3.5 million inodes allocated. And I had only a little over 1 million files in the system. I do not know how ext4 had used up all the inodes but I found that when I removed my code branches from the file system, inode usage had dropped to 12%. 

So, after some discussion with my coworkers I've decided to create a separate partition using 'reiserfs' as it can better support a large file systems with small files. Since it omits the use of inode table, it does not assign a static number of inodes like in ext4. Now (I think) I do not need to worry about this issue anymore.