LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-22-2009, 04:29 AM   #1
sunil470763
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Rep: Reputation: 0
how to save 20mb file in unix if inode size is 2Kb(default)


hi dear ,

i am new user of linux i am unable to understand the file system .my problem is that if i am creating a unix file system with 2Kb per inode then can we save 10mb file on the system. if yes then what happen with inode and inode table.

Thanks in Advance

Sunil Kumar
 
Old 07-22-2009, 04:50 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Welcome to LQ!!

This sounds like homework...
I would suggest some Google searches. If this is homework, please tell us about the class, what books you use, etc.
 
Old 07-22-2009, 05:02 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Hello Sunil Kumar :-)
Quote:
Originally Posted by sunil470763 View Post
hi dear ,

i am new user of linux i am unable to understand the file system .my problem is that if i am creating a unix file system with 2Kb per inode then can we save 10mb file on the system. if yes then what happen with inode and inode table.

Thanks in Advance

Sunil Kumar
Except in special circumstances, a file's inode does not contain the data. See http://wiki.answers.com/Q/What_is_an...umber_in_Linux for a simple explanation of what an inode contains. What it doesn't say is that the inode also contains pointers to the file's data blocks. See http://wiki.linuxquestions.org/wiki/Inode for a more complicated explanation and http://en.wikipedia.org/wiki/Inode for a more complete explanation.

If the file needs more data blocks than can be pointed to by a single inode then the last pointer goes to another inode containing pointers to further data blocks and so on. Nice diagram at http://en.wikipedia.org/wiki/Inode_pointer_structure.

You can see a lot of what is in an inode using the stat command:
Code:
c@CW8:~$ stat ~/.bashrc
  File: `/home/c/.bashrc'
  Size: 2931      	Blocks: 8          IO Block: 4096   regular file
Device: fe02h/65026d	Inode: 583364      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/       c)   Gid: ( 1000/       c)
Access: 2009-07-22 01:11:20.000000000 +0530
Modify: 2008-08-03 21:24:33.000000000 +0530
Change: 2008-08-03 21:24:33.000000000 +0530
It is possible to have more than one inode pointing to the same file data. This is called "hard linking".

So what is the file? It's inode(s) or its data? Both!

Best

Charles
 
Old 07-22-2009, 05:19 AM   #4
sunil470763
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Original Poster
Rep: Reputation: 0
dear ,
my question is that if we have to format our hard dish with unix file system then it will make a inode table this table have a no of inode can be assined to the files (or we can say total number of inodes created(logically) on the disk ).so if file system take 2Kb size(default size) to create (logically) inode table . then can we save a 10 MB file on the system while i know that if we have create(logically) more inode with small space we can save more file and if we have create(logically) less inode with large space then we can save less but large files.so resolve the problem

thanks
sunil kumar
 
Old 07-22-2009, 07:15 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by sunil470763 View Post
dear ,
my question is that if we have to format our hard dish with unix file system then it will make a inode table this table have a no of inode can be assined to the files (or we can say total number of inodes created(logically) on the disk ).so if file system take 2Kb size(default size) to create (logically) inode table . then can we save a 10 MB file on the system while i know that if we have create(logically) more inode with small space we can save more file and if we have create(logically) less inode with large space then we can save less but large files.so resolve the problem

thanks
sunil kumar
You can optimise use of a file system by adjusting the size of the inode table to suit usage but it is only useful in extreme circumstances such as when the whole disk is given over to a very small number of fixed size files -- as might be the case for a large database -- or when the file system will contain a very large number of very small files.

For general use the default size inode table uses the space efficiently enough.

If you plan to fill the file system so need to be so careful then you will get poor disk performance. Anything over say 80% used will slow the system as it hunts around for space and will cause fragmentation.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Speaking UNIX: It’s all about the inode LXer Syndicated Linux News 0 06-11-2008 04:11 PM
Can you write a script to display file name, Inode, and size of any file? JaxsunApex Linux - Newbie 3 01-30-2007 08:39 AM
Create a script to display file name, Inode, and size of any file. Has to be a script JaxsunApex Linux - Newbie 7 01-29-2007 08:15 PM
Relation between inode and cluster size. Milosevic Linux - Hardware 1 12-11-2005 11:05 AM
question about inode size PTBmilo Linux - General 2 03-02-2003 02:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration