how inode works


 
Thread Tools Search this Thread
Operating Systems Solaris how inode works
# 1  
Old 01-15-2009
how inode works

HI,

Just another dummies questions:
How i can determine what number of inode to use when creating filesystem?

Thanks
# 2  
Old 01-15-2009
There are a LOT of rules of thumb about this.

If you are going to have one or two gigantic database files you want few inodes, like say, less than 500, because inodes require space on the disk and you want as much disk available as possible.

If it is general use, probably about 1 inode per every two blocks (of whatever physical size the blocks are). So if you have 1000 blocks (dumb example, extra small disk) then you would want maybe 500 inodes. In the worst case this will waste disk space on unused inodes. The other way, if you have too few inodes then you get the 'too many files' error. Then the disk cannot be written to, even though it has free space.

If you are storing only media files which are large, maybe 1 inode for every 500 or 1000 blocks.

Other people will give other estimates, so ask around.
# 3  
Old 01-15-2009
Jim is absolutely correct, just to explain where all these "rules of thumb" come from:

For every file you need exactly one inode, which contains the information the filesystem has about the file. In this data structure, for instance, the information which "ls" displays is stored. It doesn't matter how big or small the file is, even if it contains nothing at all it still needs an i-node. Links, btw., are just inodes, which point to another inode. So links also need one inode.

That means: the number of inodes you need depends on the size of the disk and your estimation about how big the average file (in fs blocks) in it is going to be. Jim has already mentioned databases, because they have usually a few very big files. A multi-terabyte Oracle database might consist of, say, a hundred files, thats all. On the other side of the spectrum are log directories of tools which produce many very small logfiles. Most filesystems are somewhere in between these extremes.

Run a "find" command over the various filesystems on some machines and calculate the average file size and the number of the files to get some empirical data to build on your experience.

If in doubt between two variants, opt for the bigger number of inodes. The space wasted this way is not that much and certainly not as big as the space wasted if the filesystem runs out of inodes.

I hope this helps.

bakunin
# 4  
Old 01-15-2009
Thank you very much for both of you. It's great answers.
# 5  
Old 01-16-2009
ooo i've had some nighmares about inodes!!

you may want to leave your default inode (number of bytes per inode = nbpi) for now until you have a good idea what EXACTLY is going on this server. wrongly configured and you could waste space or run out of inodes rather quickly.

take a look at this link and it will show you some general calculations: Number of Inodes (Files) (System Administration Guide: Devices and File Systems) - Sun Microsystems

few more things. newfs (i assume you are looking at a ufs fs) will allow you to change your nbpi. growfs i believe will also change the number of inodes as the filesystem grows.

if you are curious, use `df -F ufs -o i` to see current free v. used inodes on a system.

output from my x86 box.
Code:
-bash-3.00# df -F ufs -o i
Filesystem             iused   ifree  %iused  Mounted on
/dev/dsk/c2d0s0        24035 2404573     1%   /
/dev/dsk/c2d0s6       151478 8345738     2%   /usr
/dev/dsk/c2d0s1        20052 2408556     1%   /var
/dev/dsk/c2d0s5        10358 7269642     0%   /opt
/dev/md/dsk/d0         74978 28503390     0%   /data
/dev/dsk/c2d0s7           67 8054525     0%   /export/home

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Specify the inode of a file?

Is there any way to create a file on Solaris 10 (ZFS preferably, but UFS would be helpful as well) with a specific inode number? I need to create a file with a large inode, greater than a 32bit integer. I am trying to test a piece of software which may be incorrectly truncating large inodes down... (16 Replies)
Discussion started by: unblockable
16 Replies

2. Solaris

inode in solaris

Dear, How can i check inode information in my Solaris box? With Regards, Mjoshi (4 Replies)
Discussion started by: mjoshi87
4 Replies

3. UNIX for Dummies Questions & Answers

inode filename

can someone please tell me why is the filename not inlcuded in the inode of the file? (2 Replies)
Discussion started by: wowman
2 Replies

4. AIX

FS inode 58%

Hi Guys, I have this filesystem got big with inode: /dev/hd4 3670016 183664 95% 63705 58% /var I don't know why the system doesn't give alerts on this FS although it's 95% and why the inode is 58%. Any comments will be highly appreciated. Thanks, itik (1 Reply)
Discussion started by: itik
1 Replies

5. Solaris

about inode

how can i see inode table information of a perticler inode.anybody knows pls tell me. Than.Q (3 Replies)
Discussion started by: nag.mi2000
3 Replies

6. UNIX for Dummies Questions & Answers

incore inode

Dear Friend , what is incore inode ? and what is difference between incore inode and inode ????? sanjay (1 Reply)
Discussion started by: sanjaygoyan
1 Replies

7. Red Hat

inode no and fd path

hi, can anyone please tell me where i can extract inode numbers and path associated with all file descriptors. i want these informations only. is there any system call or functions to get these things? i hav a RHEL 4. also /proc/pid/fd shows some file descriptor list. is that the proper path to... (1 Reply)
Discussion started by: sanjaykhuntia
1 Replies

8. Filesystems, Disks and Memory

Inode number

as kernel keeps track of user activities on a file by its INODE number and I node table . what is the structure of Inode table. and where does this Inode table mapped into?user space or kernel space? is the Inode Number is fixed for a file till its deletion? thanks (1 Reply)
Discussion started by: compbug
1 Replies

9. Shell Programming and Scripting

INode

hi i am nitin... jus a new kid on the block... my query is... does the concept of region invovle sharin of inodes wen the sticky it is set... eg... if two process share two text regions... wat actually happens thank u (1 Reply)
Discussion started by: nitinsharma_ssn
1 Replies

10. AIX

%Inode used full

Hello I have used 100% of inode in a file system can you increase thie number of inode without backup-make the file system again-restore ? thank you (0 Replies)
Discussion started by: pascalbout
0 Replies
Login or Register to Ask a Question