PLEASE EXPLAIN THE FOLLOWING OPERATING SYSTEMS QUESTION AND SOLUTION TO THE QUESTION IF IT IS THE RIGHT SOLUTION.
Consider an index-based file system with the inode containing 64 indexes, 1 indirect index pointing to a disk block containing an array of direct indexes, and 1 2-level index in the usual way. Assume that each index takes 4 bytes.
What is the maximum file size under this arrangement, if a disk block is 1024 bytes? Explain how do you compute this maximum size.
Solution:
An indirect block has 1024 bytes * 1 index/4 bytes = 256 pointers
So a file has at most 64 + 256 + 256*2 blocks and (64 + 256 * 256^2) * 1024 bytes.
How many disk accesses does it take to read one disk block at location 3000321 within a file, assuming no caching. Justify your answer.
Solution:
Block 3000321 is block number 2930, which means we have to read the inode, the 2-level index, a direct index, and the data block. 4 reads.