Suppose you have a Linux file system where

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?
i➥ 513 Kbytes
ii➥ 513 Mbytes
iii➥ 537 Mbytes
iv➥ 537 KBytes
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 + 218

Maximum 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 MByte

Note:  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. 

More related Questions on File System
Read more
More related Questions on Operating System
Read more
More Questions on June 2021
Read more

You are welcome to give the better solution for this question

Suppose you have a Linux file system where

Leave a Comment

Your email address will not be published.

error: Content is protected !!
Open chat
1
Hi,how Can We Help You ?