Estimate the overhead of inserting (adding) a new block, using the number of the
ID: 3830194 • Letter: E
Question
Estimate the overhead of inserting (adding) a new block, using the number of the necessary disk accesses, in an existing file using the contiguous, linked-list, and index allocation methods for the following cases:
Here are the EXERCISE #2 assumptions:
Contiguous Linked-List lst sector N-th MM sector Use the following assumptions: (1) Use the same assumptions we used for EXERCISE #2. (2) The target file consists of Mdata blocks CM sectors). (3) Writing a sector requires the OS one disk access. (4) Each file directory fits to a disk sector. (5) For the index allocation method, the index fits to a disk sector. IndexExplanation / Answer
1.For contiguous allocation the data blocks are stored continuously.To add a data block
a)at 1 sector, move M blocks to the end by one position and add the block at the begining and it requires 2M+1 IO operations.
b)at Nth sector,move N sectors by one position and add the block at the desired position,it requires 2N+1 IO operations.
2)For Linked allocation,theblocks of a file are stored non contiguously and can be accessed through links.
a)For 1st sector,modify the starting address and add one block at the begining ,1 IO operation.
b) For Nth sector,Seek the position by reading N blocks and add new Data block,so N+1 IO operations
3)For indexed allocation,an index block is maintained which contains pointers to data blocks.
a)For 1st sector,modify the index block and add one block,1 IO operation
b)For Nth sector,modify the index block and add one block ,1 IO operation
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.