edited by
1,959 views
1 votes
1 votes
Given a disk-block size of $4\: KB$ and block-pointer address value of $4$ bytes, what is the largest file size (in bytes) that can be accessed using $10$ direct addresses and one indirect block?
edited by

3 Answers

3 votes
3 votes

Answer:

The Disk Block Size $= 4 \; \text{KB}$

Block Pointer address value $= 4\; \text{Bytes}$

Number of addresses $= \frac{4\; \text{KB}}{4\;\text {Bytes}} = \frac{2^{12}}{2^2}=2^{10} = \mathbf{1\;K}$

Largest File Size that can be accessed  using 10 direct addresses and one indirect block $= 10\;\text{Direct addresses} + 1 \; \text{Indirect block} =  [ 10 + 2^{10}  ] \times 4\;\mathbf{KB} = 4136 \;\textbf{KB}$

So, Largest Size possible $= 4136\;\textbf{KB}$.

edited by
1 votes
1 votes
Given that

Disk Block Size = 4KB

Block Pointer address value (DBA) = 4 Bytes

Number of Disk block addresses on one disk block = Disk Block Size /  Disk block address

=   2^(12) /  2^(2) = 2^(10)

 

Here find the largest file size  =  [ # of direct block +  ((DB size / DBA)^1 ).+.............. ] *  DB size

 =  [10  +  ( 2^(12)  /  2 ^(2) ) ]  *  4KB  =   4136 KB
1 votes
1 votes

Answer = 4MB 

Block size = 4KB , Block address = 4B , Direct address = 10 , Single Indirect address = 1

No. of address per block = [no. of direct address + (Block size/block address) ]*4KB

                                        = [10+(4KB/4B)]*4KB

                                        = [10+1KB]*4KB =40KB + (2^10B * 2^12B ) =2^2 * 2^20B    // 40KB is negligible w.r.t 4MB

                                        = 4MB 

OR

 if you do't want to neglect it then,

40KB+4MB = 40KB+4096KB = 4136KB  

Related questions

0 votes
0 votes
0 answers
2
0 votes
0 votes
0 answers
4
admin asked Oct 27, 2019
275 views
Write a program that reverses the bytes of a file, so that the last byte is now first and the first byte is now last. It must work with an arbitrarily long file, but try ...