11. Consider a file system that uses a structure similar to an i-node with the f
ID: 3729502 • Letter: 1
Question
11. Consider a file system that uses a structure similar to an i-node with the following differences. If the file size is less than 100 bytes, the data is stored directly in the i-node. If it is larger, there are 6 direct links (point to a data block), 1 single-indirect links, 2-double indirect links and 1 triple indirect link. (a) What is the largest file size that can be indexed in this system? Assume the block size is 512 bytes. (3 points) (b) How many blocks (including index blocks) are needed to address a file of size 50 bytes, 500 bytes, 50Kbytes, and 5Mbytes? (4 points)Explanation / Answer
Solution:
If the disk address is 16 bits and the block size is given as 512 byte
Number of entries = 512/16 bits = 512/2 byte = 256 entries
direct links = 6=> 6*512 = 3 KB
single indirect link = 256 * 512 = 128 KB
double indirect link = 256 * 256 * 512 = 32*2 = 64 MB
triple indirect link = 256 *256 *256 * 512 = 8 GB
Maximum file size = 8 GB
b)
If the block size is 50 bytes
It requires only 1 direct block
If the block size is 500 bytes
It requires only 1 direct block, since the block size is 512 bytes
If the block size is 500 Kbytes
It requires only 6 direct block, and 92 sigle indirect
If the block size is 5 Mbytes
It requires only 5 * 2^20/512=> 10240
6 direct, rest are single indirect addressing.
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.