Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inode issue

Status
Not open for further replies.

warmongr

MIS
Mar 17, 1999
214
US
I am using a backup server that is an inode hog.  I must increase the amount of inodes or tune the use of inodes to be more efficient.  Any ideas on how to do this?
 
This may be a newbie question, but what is an inode? and what are they used for?<br><br>Thanks<br><br><br> <p> fenris<br><a href=mailto:fenris@hotmail.com>fenris@hotmail.com</a><br><a href= > </a><br> I am interested in Mining Software, as well as Genetic Algorithms.
 
Warmongr,<br><br>I've not done this in Linux - but in other unices it's a <FONT FACE=monospace><b>newfs</font></b> option.<br><br>Fenris,<br><br>An inode holds details of a single file, creation time, modification time and so forth -- one inode = one file -- so you have to specify if you're going to have a lot fo files.<br><br>That's right isn't it warmongr?<br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Yup.&nbsp;&nbsp;When you run out of inodes, it's either clean up or reformat.<br><br>fenris,<br><br>As Mike says, the inode describes a file.&nbsp;&nbsp;But inodes are made up of fixed-size structures that don't contain the file name or any directory structure information.&nbsp;&nbsp;That is why *n*x file names can be very long (limit varies depending on which *n*x) - they are stored, along with directory structure information, in a variable length structure outside the inode block.&nbsp;&nbsp;This is why when you move (mv) a file within the same disk partition (*n*x &quot;filesystem&quot;) the move happens so fast - the file stayed right where it was.&nbsp;&nbsp;The inode wasn't even touched, only the filename-directory structure was tweaked.&nbsp;&nbsp;Once the OS has found a file by name, it only uses the inode number to refer to the file.&nbsp;&nbsp;Filenames are for sissies (users), not the OS.<br><br>Also, links live only in the filename area.&nbsp;&nbsp;A &quot;hard&quot; link is just a different name for the same inode refered to by it's &quot;proper&quot; name.&nbsp;&nbsp;A symbolic link just points to another entry in the filename area, not to an inode, which is why symlinks are slower than hard links - gotta make two (or more) name lookups before you can find the inode. <p>Octalman<br><a href=mailto: > </a><br><a href= > </a><br>
 
You are all correct. In linux there are some files that can be tweaked to help modify/optimize your file systems inode use.&nbsp;&nbsp;They are:<br><br>/proc/sys/fs/file-max<br>/proc/sys/fs/inode-max<br>/proc/sys/fs/inode-nr<br><br>These can be modified like the following<br>cat /proc/sys/fs/file-max<br>&nbsp;&nbsp;You should see a number like 4096<br>I bumped mine up using:<br>echo 12288 &gt; /proc/sys/fs/file-max&nbsp;&nbsp;(3 times the amount showing 4096*3)<br>echo 36864 &gt; /proc/sys/fs/inode-nr&nbsp;&nbsp;(3 times the amount of file-max)<br><br>I then moved my back-up server database to another partition which had plenty of inodes.&nbsp;&nbsp;The back-up ran fine.&nbsp;&nbsp;More as a result of moving files than the file system tweaks.&nbsp;&nbsp;<br><br>***&nbsp;&nbsp;These file system mods should not be made just to make them.&nbsp;&nbsp;If you constantly get errors indicating 'not enough file handles' or you are constantly running out of inodes then try this and see if your problem goes away.&nbsp;&nbsp;Otherwise as stated above (and what I am doing today) is to rebuild.&nbsp;&nbsp;If your problem is resolved and you want to keep the above mods you will have to modify your /etc/rc.d/rc.local to include the above echo statements otherwise your files will go back to normal next time you boot.<br><br>If you want more documentation on it check /usr/local/src/Documentation/sysctl/fs.txt <br><br>Hope someone gets some use out of this.<br><br>I'm outta here!<br><br>War...
 
Thanks for answering my question on inodes as well. <p> fenris<br><a href=mailto:fenris@hotmail.com>fenris@hotmail.com</a><br><a href= > </a><br> I am interested in Mining Software, as well as Genetic Algorithms.
 
I must submit a flame to myself.&nbsp;&nbsp;In my above post I stated:<br><br>echo 36864 &gt; /proc/sys/fs/inode-nr&nbsp;&nbsp;(3 times the amount of file-max)<br><br>It should have said:<br><br>echo 36864 &gt; /proc/sys/fs/inode-max&nbsp;&nbsp;(3 times the amount of file-max)<br><br>I then said the documentation could be found in /usr/local/src/Documentation/sysctl/fs.txt while in fact it is in /usr/src/linux/Documentation/sysctl/fs.txt.<br><br>My apologies if you have corrupted any files however if you have made the changes above I will give you full refund.&nbsp;&nbsp;Really though remove the lines from your rc.local and reboot your machine.&nbsp;&nbsp;They will go back to the system default.&nbsp;&nbsp;<br><br>Sorry,<br>war...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top