edited by
1,213 views
2 votes
2 votes
Consider a file system in which the index table in the directory holds 32 pointers(DBA's) if the file size is within 32 blocks then these 32 addresses act as direct DBA's . Otherwise if file size is more than 32 blocks then these addresses act as indirect DBA's each of which points to blocks that hold addresses of data blocks. if DBS is 4KB and DBA is 32 bits then max file size in MB is ___________
edited by

1 Answer

Best answer
5 votes
5 votes

It is given number of block addresses an inode can store  =  32

Now each of these may point to data blocks directly or indirectly to the actual data blocks as mentioned in the question also..

If we want maximum file size , we can have all of 32 pointers as indirect ones instead of a few direct and a few indirect..

In single indirect scheme :

Disk block address given in inode points to another index node .One of  the entry of index node , in turn points to the actual data block..The number of entries in each index node is decided by the block size and block address size(which is normally a few bits)

Number of entries possible in a single index node  =  Disk block size / Disk block address size

                                                                          =  4 KB / 32 bits 

                                                                          =  4 KB / 4 B  

                                                                          =  210

Now total number of pointers possible                    = Number of pointers in inode * Number of pointers per node which is pointed by main inode

                                                                           = 32 *  210

                                                                           = 215

Each of these pointers will point to actual data block

Hence maximum file size                                      = Maximum number of pointers to data block * Data block size

                                                                           = 215 * 212

                                                                           = 128 MB

Hence maximum file size                            = 128 MB

selected by

Related questions

1 votes
1 votes
1 answer
1
A_i_$_h asked Jan 25, 2018
376 views
when question asks about maximum file size sometimes only the size of the biggest pointer ( eg. triple indirect pointer) is considered and some solutions take the sum of ...
2 votes
2 votes
2 answers
4
Ashwani Kumar 2 asked Feb 7, 2017
1,684 views
I am getting 282. Answer given is 256..??