895 views

In a particular Unix OS, each data block is of size 1024 bytes, each node has 10 direct data block addresses and three additional addresses: one for single indirect block, one for double indirect block and one for triple indirect block. Also, each block can contain addresses for 128 blocks. Which one of the following is approximately the maximum size of a file in the file system?

1. 512 MB
2. 2 GB
3. 8 GB
4. 16 GB

Maximum file size = 10*1024 Bytes + 1*128*1024 Bytes + 1*128*128*1024 Bytes + 1*128*128*128*1024 Bytes = approx 2 GB.
selected
How to solve its calculation part?
the largest term is 2^31 which acoounts to 2 GB.
TRIPLE INDIERECT FILE SIZE IS 2 GB....WHY DO WE DON'T CONSIDER SIZE OF OTHER FILES?

### Size of File/Levels

Level-0 10*1024 B           1             1               1
Level -1   1*128*1024 B 1*128*1024 B 1*128*1024 B
Level- 2     1*128*128*1024 B     1*128*128*1024 B
Level -3       1*128*128*128*1024 B

Add the Principle Diagonal Values = 2.01575 GB = Approx. 2.0 GB

why multiplied by 1 in indirect address (though it will not effect the result but just curious about it )

Its 2GB

pls somebody make it understand to mee pls pls explain

They are asking size of the file. That means all we need to calculate is number of blocks*size of block to know the size of file. since files are being stored as blocks.

To calculate total number of blocks

Block size =1024 bytes

1)Directly given blocks   10*1024 bytes

2)single indirect block    1*128*1024 bytes  (since 1 block is pointing to a block which has 128 address of 128 blocks each of size 1024. since it is given each block will have address of 128 other blocks

3)double, triple indirects with same logics

totally adding them gives total block sizes