In a file system, each file has a directory entry giving the file name, location
ID: 3682760 • Letter: I
Question
In a file system, each file has a directory entry giving the file name, location of the first block, length of file, and last block position. All blocks are of the same size. Assume that the last physical block read and the directory entry are already in main memory. Indicate how many physical blocks must be read to access the specified block (including the reading of the specified block) on a system using contiguous allocation when last block read: 100; block to be read: 600 last block read: 500; block to be read: 200 last block read: 20; block to be read: 21 last block read: 21; block to be read: 20 Repeat the previous problem for a system using linked allocation. Repeat the previous problem for a system using indexed allocation. Assume the directory entry contains the location of the first index block (not the first block of the file). Each index block contains pointers to 127 file blocks plus a pointer to the next index block. Assume that in addition to the last block read, the system has in main memory the index block that contains the pointer to the last block read. However, no other index blocks are in main memory.Explanation / Answer
1. The answer for all the four scenarios is one. The location of the physical block to be read can be computer from the block number and the location of the first block
2.
a) Last block read :100; Block to be read: 600
500. Blocks 101 through 599 must be read to obtain the link to the next block.
b) Last block read :500; Block to be read: 200
200. To find block 200, the chain of blocks starting with block 1 must be read
c) Last block read :20; Block to be read: 21
1 . Block 20 Contains a pointer to block 21
d) Last block read : 21; Block to be read: 20
21 . To find block 21, the chain of blocks starting with block 1 must be read
3.
a) Last block read :100; Block to be read: 600
5. The last block read is pointed to by index block 1 , which will also be in memory. The pointer to block 600 is in
the fifth index block. Index blocks 2 through 5 must be read before reading block 600
b) Last block read :500; Block to be read: 200
3. Index block 4 is in momory . The pointer to block 200 is in the second index block. Index blocks 1 and 2 must
be read before reading block 200
c) Last block read :20; Block to be read: 21
1 . The pointer to block 21 is in the first index block which is the same index block used by block 20
d) Last block read : 21; Block to be read: 20
1 . The pointer to block 21 is in the first index block which is the same index block used by block 20
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.