CS FundamentalsHardGATE CS · Advanced

A file system has 1 KB blocks and 4-byte block pointers; the inode (already in memory) holds 12 direct pointers and one single-, one double- and one triple-indirect pointer. There is no block cache. How many disk block reads are needed to read the logical blocks 5, 100, 30000 and 70000 (numbered from 0) one after the other, each by itself from the inode?

  1. A. 14
  2. B. 11
  3. C. 10
  4. D. 9

Correct answer: C. 10

With 256 pointers per block: block 5 is direct (1 read), 100 is in the single-indirect range 12-267 (2 reads), 30000 lies in the double-indirect range 268-65803 (3 reads), 70000 is beyond that, so triple-indirect (4 reads). Total 10. Counting the inode read for each block would add 4.

More Operating Systems questions

Exams that ask this topic