CS FundamentalsVery hardGATE CS

Same inode (10 direct, 1 single-indirect, 1 double-indirect; 1 KB blocks; 256 pointers per block). The inode is already in memory and nothing else is cached. How many disk reads are needed to read the byte at offset 300,000 of a file?

  1. A. 2
  2. B. 4
  3. C. 1
  4. D. 3

Correct answer: D. 3

300,000 / 1024 gives logical block 292. Blocks 0-9 are direct and 10-265 single indirect, so 292 is in the double-indirect range: read the double-indirect block, one single-indirect block and the data block: 3 reads.

More Operating Systems questions

Exams that ask this topic