Solved

i-node and UNIX file system

Posted on 2009-04-09
16
544 Views
Last Modified: 2013-12-26
Ok I am confused with the way i-nodes and how it works... index 0-12 is used to be a pointer to the direct address... so therefore it can represent 48K, in other words each pointer can represent 4 bytes of data, if it's a 4 byte disk address... however I don't see how a 4 byte of disk address can represent 4 bytes of data... can someone please enlighten me
0
Comment
Question by:kuntilanak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
16 Comments
 
LVL 78

Expert Comment

by:arnold
ID: 24109317
The disk address can represent as much data as needed.
inode -> disk location where the header of the file is. Each section if the file does not fit in a single contiguous location, has a reference to where the next section of this file is and so on and so forth until the section where the next section pointer is NULL.


Take a 10MB disk.
Divide it into 2 inodes where each inode represents 5MB
The first section will be 0 and the second section will be 1.

Now you create a 4MB file that is pointed to by inode 0 and you have 5MB of storage left.
Now you create a 64k file which is only accessible through inode 1 and you no longer have any storage left.

If you were to create a 6MB file rather than a 4mb, you would use inode 0 and will no longer have any space available.

0
 

Author Comment

by:kuntilanak
ID: 24109367
lets just take a look at the picture below first:


what is the size of each rectangle? assuming the size of each data block is 4K, does it mean that each rectangle size is 4K
IndirectBlocks.png
0
 

Author Comment

by:kuntilanak
ID: 24109371
what I mean by rectangle here is the gray rectangle with index 1.. is that a data block?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 24112133
if you look to the figures in the picture you attached:

12 + 48K

if the file system is 4k data blocks (the green ones) then

(48 * 1024) / (4 * 1024)  = 12 which means that you need 12 blocks references to point to files up to 48k in size

1024 + 4M

(4 * 1024 * 1024) / (4 * 1024) = 1024 which means that you need 1024 blocks references to point to files up to 4M in size

0
 

Author Comment

by:kuntilanak
ID: 24112483
what do you mean by 12 + 48K?
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24112559
these are the figures show on top of each column in the diagram
0
 

Author Comment

by:kuntilanak
ID: 24112946
I am just confused how can the index 13 can have 1024
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24112984
it is indirectly pointing to file. it points to other blocks which have indexes for the file blocks
0
 

Author Comment

by:kuntilanak
ID: 24113175
I know that it points to another blocks.. but how did you get 1024 from.. is it from 4KB/4 byte
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24113680
please my previous comment: http://#24112133
0
 

Author Comment

by:kuntilanak
ID: 24113693
why did you divide it by 4*1024?
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24113719
because the block size where the file data will be stored is 4k (4*1024)
0
 

Author Comment

by:kuntilanak
ID: 24116051
you're just converting k to bytes??
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24116285
I did not understand your last comment
0
 

Author Comment

by:kuntilanak
ID: 24116561
when you do 4 * 1024,  4here is in KB and are you just multiplying it by 1024 to convert it to bytes?
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24117227
yes
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unix process listing into CSV format 3 53
Searching File Names and Eliminating Duplicates in Linux 4 84
Problem to open Excel file 15 226
Adjust the codes 3 35
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question