LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-24-2007, 12:51 PM   #1
alokatzenith
LQ Newbie
 
Registered: Aug 2007
Posts: 16

Rep: Reputation: 1
simple unix file system problem


In case of UNIX file system, how many pointers from I Node block are needed to access memory size of 1,00,000 bytes of data? (Assume 1 pointer= 4 bytes, 1 block = 512 bytes)

Can anyone provide me the solution to above problem??
 
Old 10-24-2007, 01:09 PM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Smells like homework to me. I could be wrong, but you could tell us which way it is - and in case it's homework, read the rules of posting again, to find out what they say about homeworks and helping in them.

If it is a homework, maybe you should re-read the material in which you are introduced to this thing. Nobody, say an ape, can tell the answer if we assume that not everybody knows what "UNIX filesystem" means, so I'll assume you either have material, or have been shown how these things are calculated.

If I'm wrong and this is not a homework, just happens to sound like one, please correct me. In any case, how would you think it was? What is your lucky guess? Why?
 
Old 10-25-2007, 12:52 PM   #3
alokatzenith
LQ Newbie
 
Registered: Aug 2007
Posts: 16

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by b0uncer View Post
Smells like homework to me. I could be wrong, but you could tell us which way it is - and in case it's homework, read the rules of posting again, to find out what they say about homeworks and helping in them.

If it is a homework, maybe you should re-read the material in which you are introduced to this thing. Nobody, say an ape, can tell the answer if we assume that not everybody knows what "UNIX filesystem" means, so I'll assume you either have material, or have been shown how these things are calculated.

If I'm wrong and this is not a homework, just happens to sound like one, please correct me. In any case, how would you think it was? What is your lucky guess? Why?
Hi there.

This is not at all a home work. I m trying to learn Linux programming on my own. I m also surfing net for this purpose and i got this question somewhere on net. So plz give me some reply.

Thanks
 
Old 10-25-2007, 01:12 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
What specific file system?? Linux has many, and I assume the same is true for Unix--in all its flavors.

Quote:
memory size of 1,00,000
Do you mean file size ...or maybe disk space?
Is it 10,000 or 100,000?
 
Old 10-25-2007, 01:26 PM   #5
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by pixellany View Post
What specific file system?? Linux has many, and I assume the same is true for Unix--in all its flavors.
I almost said the same thing, but then remembered that UFS is "Unix File System".
ta0kira
 
Old 10-25-2007, 01:41 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by ta0kira View Post
I almost said the same thing, but then remembered that UFS is "Unix File System".
ta0kira
ambiguity created by missing articles? But then, "the Unix file system" would still be ambiguous.....

Actually, specific file systems usually seem to go only by their acronym: ext2 ext3 fat ntfs........Reiser (oops!!!)
 
Old 10-25-2007, 02:41 PM   #7
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Is it just me, or is it just a simple math problem disguised as a programming one? Am I ignorant in thinking that it might be solved by merely "arithmetizing" the provided numbers? That would be a lot easier if I knew whether it was 10,000, 100,000, or 1,000,000. Maybe I am just plain wrong.
ta0kira
 
Old 10-26-2007, 11:54 AM   #8
PAix
Member
 
Registered: Jul 2007
Location: United Kingdom, W Mids
Distribution: SUSE 11.0 as of Nov 2008
Posts: 195

Rep: Reputation: 40
You might well be right Ta0kira. I thought it myself when I first read the question, but I was thinking of the "Emperors New Clothes" at the time so held my tongue. The answer to the question should maintain the same degree of precision of the original so the answer has to be 196 pointers to 512 byte blocks = 99841 to 100352 bytes. Plus 1 for the initial inode perhaps which makes 197?
Of course this might be expressed as 19,7 as mentioned earlier to retain precision(?) Not to conrfuse anyone on the continent of europe who might use "," as a decimal point.

Was this a sizing exercise to determine how many inodes would be required to address x thousand bytes of storage, given that the inodes themselves would consume part of the storage. A size of of 1,000,000 is exceedingly small (very old book - first commercial Winchester technology disk was 1Mbyte, more than a few years ago). Personally I would be more than slightly inclined to move on to the next question, having got the idea of the structure of things
http://upload.wikimedia.org/wikipedi...Ext2-inode.gif

I think that there is a little more than simply the "article" missing from question, which renders it more than a little open ended. Alokatzenith you might be mistaken for a business analyst moving to programming. The precision of the original question was akin to some of the part specs I've seen in my time. Just joking, nothing personal.
 
Old 10-26-2007, 01:38 PM   #9
alokatzenith
LQ Newbie
 
Registered: Aug 2007
Posts: 16

Original Poster
Rep: Reputation: 1
Thanks

I m highly grateful to all who have spend their valuable time on this problem and replied me. But i m very sorry to say that none of the answer is correct. The problem which i have posted has 4 option associated with it viz

a)10 b)11 c)13 d)14

As i said in my earlier post that i m trying to learn Linux prog. on my own so i have posted the problem without options, thinking that it is an easy problem.


Thanks once again to all of you.
 
Old 10-26-2007, 01:49 PM   #10
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Wait, is this homework for us?
ta0kira
 
Old 10-26-2007, 06:06 PM   #11
PAix
Member
 
Registered: Jul 2007
Location: United Kingdom, W Mids
Distribution: SUSE 11.0 as of Nov 2008
Posts: 195

Rep: Reputation: 40
Don't you just love it when people play games with cards hidden up their sleeves?
Dr House has a distinct view about the honesty or otherwise of his patients!
I can't see how any of the four answers can be right. I don't suppose that there are four plausible explanations as to how the answer can be proved?
 
Old 10-26-2007, 07:34 PM   #12
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
You've stumped us all, alokatzenith! Tell us the answer, please, so we can do our other homework.
ta0kira
 
Old 10-31-2007, 02:16 PM   #13
alokatzenith
LQ Newbie
 
Registered: Aug 2007
Posts: 16

Original Poster
Rep: Reputation: 1
Unhappy hi

As i said earlier i m a student and trying to learn Linux prog. on my own So i also dont know the question. I was expecting answer from this forum but i m very sad now.

But plz try to find out the answer and plz plz reply me if anyone get the answer.

WAITING FOR REPLY.
 
Old 10-31-2007, 03:25 PM   #14
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
How can it be that you know the answer, but not the question. What you wrote is not clear to anyone because there is no such number as '1,00,000'.
And, when you say Unix file system do you mean to refer to UFS?
 
Old 11-01-2007, 10:32 AM   #15
PAix
Member
 
Registered: Jul 2007
Location: United Kingdom, W Mids
Distribution: SUSE 11.0 as of Nov 2008
Posts: 195

Rep: Reputation: 40
Quote:
I m highly grateful to all who have spend their valuable time on this problem and replied me. But i m very sorry to say that none of the answer is correct. The problem which i have posted has 4 option associated with it viz

a)10 b)11 c)13 d)14

As i said in my earlier post that i m trying to learn Linux prog. on my own so i have posted the problem without options, thinking that it is an easy problem.
You are correct, it is easy to provide an answer for your question. I have no difficulty in absolutely identifying answer d). 14 as the best answer. Of the candidate answers, this is the one most likely to safely satisfy the requirement. In practical terms, given this question and having to allocate a number of pointers to reliably satisfy the requirement.

My logic is that the penalty for getting the answer wrong and not being able to properly address the memory correctly is abject failure and would result in the project failing. Knowing this, I am convinced that you all would select answer d as the safest and most likely candidate, given that the answer must be taken from one of the supplied answers. More project psychology than technical detail at the end of the day. Fail safe, memory is cheap and time is money.

Ta0kira, I see you stroking your chin, such wisdom!

I'm sorry that it has taken us so long to arrive at this result. I trust that you are happy again now. Good luck with your other studies.

PAix
 
  


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: Move an entire file system on a live Unix system LXer Syndicated Linux News 0 07-08-2006 05:33 PM
unix file system anwerreyaz *BSD 1 06-30-2006 12:04 AM
explain the ( very messy ) unix file system ? xconspirisist Linux - General 11 10-16-2003 12:52 PM
Unix file system Swift&Smart General 4 02-17-2003 10:45 AM
UNIX file system changes Micha Agovic Linux - General 6 07-31-2001 06:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:05 AM.

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