1

Consider the i-node shown below. If it contains 10 direct addresses and these were 8 bytes each and all disk blocks were 1024 KB, what would the largest possible file be?

enter image description here

I can't understand how to tackle this problem.

Considering that "all disk blocks were 1024 KB" and entries are 8 bytes, the indirect block can hold 128 address. So we have 10 direct address + 128 indirect addresses for a total of 138 addressable disk blocks.

The official solution says "Since each block is 1KB, the largest file is 138KB".

Why? The text says that all blocks are 1024KB, how can be that now blocks are 1KB?

matteo-g
  • 213
  • 2
  • 9
  • 1
    Are you sure the disk blocks are 1024 KB each? If so, wouldn't this allow 131,072 eight-byte entries in the Indirect Block? With this many entries, giving a 1024 KB size blocks, this would be an extremely large limit. – fysnet Dec 14 '19 at 15:43
  • The whole problem (and the official solution) makes sense if we change in the text "all disk blocks were 1024 bytes". NOT 1024 KB! Assuming that blocks are 1024 bytes. The indirect block can house 1024/8 = 128 extra blocks. We add 128 extra blocks with the 10 direct one for a total od 138 blocks. Being blocks 1KB (1024 bytes) we can have a max file size of 138KB (as the official solution suggest). – matteo-g Dec 14 '19 at 16:45
  • Disk blocks are typically NOT 1MB... – root Dec 15 '19 at 04:38
  • @root, I thought so but since it's a problem from a textbook, I looked at it just with the given data. – matteo-g Dec 15 '19 at 13:29

0 Answers0