# maximum size filesystem on my test … approach?

Hello all I'm new at the site, and I have a question. I got this question at a test and really like to know the correct approach to solving this problem? Here is the question.

In an indexed filesystem the first indexblock (inode) has 12 direct pointers and 1 pointer to an indirect indexblock. The filesystem is implemented on a disk with a diskblock-size of 1024 bytes. All pointers are 32 bit. Question: what is the maximum filesize (Kilobytes) of this filesystem?

If it's possible not an just an answer but an explanation.

It was a multiple choice btw with 4 answers

• a. 13 K
• b. 268 K
• c. 524 K
• d. 1036 K

As for my approach I only got as far as to know that 1 pointer is 32 bit

Also I found something else here on the site which seems very useful: http://stackoverflow.com/questions/2755006/understanding-the-concept-of-inodes

Ok i got this far There are 12 blocks and each block is 1024 bytes. 1024 * 12 = 12288 bytes or 12 KB directly accessible. Please correct me if I'm wrong. Each pointer is 32 Bit = 4Byte And to be honest at this point I'm starting to get confused especially since my answer is way over any of my multiple choice answers.

-
Did you have a guess? Or any thoughts as to how you would go about solving it? It would help us give you more useful answers if we know what your thought process was. – David Z Jun 27 '10 at 23:09
ok let me edit my post. thnx for your reply btw. – jocco Jun 28 '10 at 21:38

If you can explain to me how this file system would allocate the index blocks and data blocks for a 40 KiB file, then I could probably be of some help. But I don't have the context that you have to understand how this hypothetical file system would use the index blocks, the direct pointers in the index blocks, and the indirect index blocks referenced in the question.

There are 12 blocks and each block is 1024 bytes. 1024 * 12 = 12288 bytes or 12 KB directly accessible.

Clearly the file size limit would be 12 KB if the only way to store the data for a file was to allocate 1 data block per inode pointer. Since that isn't one of your answers I assume you're not completely understanding how a file's data is stored in this example file system.

Remember there is also a pointer to an indirect index block. What is purpose/use of the indirect index block in this file system?

The purpose of the indirect index block in this file system is IF I understand it correctly is that the indirect pointer points to an entire block of pointers.

Assuming you are correct ... you'd know better than I since I didn't take your class ... how many pointers could the indirect index block hold? How much (more) data could you store using these pointers? What would the total maximum file size be?

-
I'm editing my post a little perhaps it clarifies some things. thnx for the reply too. – jocco Jun 28 '10 at 21:44
It's true about the correct understanding of the file system , completely agree that's why I eventually got lost;). The purpose of the indirect index block in this file system is IF I understand it correctly is that the indirect pointer points to an entire block of pointers. – jocco Jun 29 '10 at 16:19
It depends , but in this example I THINK it's just 1 pointer. ( appreciate your answers btw) – jocco Jul 1 '10 at 21:10
@jocco - Why only 1 pointer? You said an indirect pointer can point to an entire block of pointers, no? – irrational John Jul 1 '10 at 23:57
sorry for the late respons I'll elaborate more tomorrow (had another pc) – jocco Jul 8 '10 at 22:38

My guess would be :

12 directly-pointed blocks
1 index block containing (1024 / 4) = 256 block-pointers

Total:  12 + 256 = 268 blocks = 268 K

Although I must remark that this question is extremely ambiguous.

-