Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Network Troublshooting => Linux Servers Support => Topic started by: keen_prat on December 07, 2012, 07:13:19 AM

Title: What are Inodes and how to increase them?
Post by: keen_prat on December 07, 2012, 07:13:19 AM
I recently ran into a problem and I have discussed it here
   
Failed to open /etc/webmin/webmin/oscache for writing : Disk quota exceeded  (http://www.linuxsolved.com/forums/index.php?topic=44975.0)


It turn out to be inodes limitation provided by host on this machine I am using, but what the heck this all inode is about, I had GBs of space free on that server and still because I ran out inodes limit, I was not able to use it

I get to know about inode usage by
df -i

But thats actually bad, anyways and how to increase them ?
Title: Re: What are Inodes and how to increase them?
Post by: dalek on December 07, 2012, 07:57:35 AM
You can't without recreating the file system.  Basically, you need to backup whatever is on that partition, reformat it and restore from backups. 

If you did not change the setting when you created the file system before, you need to use the -N option.  Make sure that N is capitalized too.  I have no idea on how to set that number tho.  I have never ran out of inodes but have read about this problem before.  This is one of those you don't want to have because it sneaks up on you.  Most people watch the space but never check on the inodes. 

You may want to check into other file systems too.  The extX family uses inodes but reiserfs doesn't and I think there are others that don't use inodes either. 

Oh, each time you create a file, the name of that file is on a inode.  So each file uses one inode for the name and where the file is located.  That's my understanding of it at least.

 :)    :)
Title: Re: What are Inodes and how to increase them?
Post by: sumit1203 on December 19, 2012, 10:10:41 AM
If you are keeping huge number of small files in your disks, this may one day cause running out of available inodes because of which even though you might have sufficient disk space, file system cannot create new files. Lets see how it works in my 1GB disk partition.

The parameter “-i” allows us to play with the number of inodes we can have in a partition. It is called “bytes-per-inode”. The bigger it is less number of inodes you will have. I have set a relatively big size “163840″ bytes per inode and the result is I have 6768 inodes. What this means indeed is I can’t create more than 6768 file.

In order to increase the number of inodes, format the partition again and specify the size.

#mkfs.ext3 -i 163840 /dev/sdb1

In order to check,use the command:
#df -i