CS FundamentalsVery hardGATE CS

A 200-block file is stored with contiguous allocation and there is no free space after it, but enough before it. The file control block is in memory and the new block's data is in memory. How many disk I/O operations are needed to add one block at the END of the file, if the whole file must be moved to the free space just before it?

  1. A. 201
  2. B. 1
  3. C. 401
  4. D. 400

Correct answer: C. 401

Moving 200 blocks costs 200 reads + 200 writes, then 1 write for the new block: 401. (Adding at the end with free space after the file would need just 1 write.)

More Operating Systems questions

Exams that ask this topic