Suppose you have a Linux file system where the block size is 2K bytes, a disk address is 32 bits, and i-node contains the disk addresses of the first 12 direct blocks of file, a single indirect block, and a double indirect block. Approximately, what is the largest file that can be represented by an i-node?
Answer:Option II Solution:Given,
Block size = 2K Bytes = 2048 Byte = 211 Byte,
Disk Address = 32 bits = 4 Byte,
Direct Address = 12,
Single indirect Address = 1,
Double indirect Address = 1,
Maximum File size = ?
Formula used,Maximum File size = Max number of Block * size of each Block.
Calculation,
Number of Address per Block = Block size/Disk Address
= 2048 B / 4 B
= 512
= 29
Maximum number of Block
= 12 direct Block + 1 single indirect Block + 1 double indirect Block
= 12 + 29 + 29* 29= 12 + 29 + 218Maximum File size = Max number of Block * size of each Block
= (12 + 29 + 218)* 211 Byte
= (12* 211 + 29*211 + 218*211)Byte
= (12* 211 + 220 + 229)Byte
≈ (220 + 229)Byte
≈ (1 + 29)* 220 Byte
≈ 513 MByteNote: we can neglect 12*211. Since, it is too small than other parameters.
Therefore, Approximately 513M byte is the largest file size that can be represented by an i-node.
So, Option(II)is correct.