November 23, 2024, 11:38:02 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: What are Inodes and how to increase them?  (Read 26595 times)

Offline keen_prat

  • Linux Noob !
  • *
  • Posts: 21
What are Inodes and how to increase them?
« 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


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 ?

Offline dalek

  • LST CareTaker
  • Crescent
  • *****
  • Posts: 243
Re: What are Inodes and how to increase them?
« Reply #1 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.

 :)    :)

Offline sumit1203

  • New Member
  • Posts: 1
Re: What are Inodes and how to increase them?
« Reply #2 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