retagged by
22,662 views
18 votes
18 votes
The index node (inode) of a Unix -like file system has $12$ direct, one single-indirect and one double-indirect pointers. The disk block size is $4$ kB, and the disk block address is $32$-bits long. The maximum possible file size is (rounded off to $1$ decimal place) ____ GB
retagged by

4 Answers

Best answer
37 votes
37 votes
Given $12$ direct, $1$ single indirect, $1$ double indirect pointers

Size of Disk block $= 4kB$

Disk Block Address $= 32 \text{ bit } = 4B$

Number of addresses= Size of disk block/address size $= \frac{4kB}{4B} = 2^{10}$

Maximum possible file size$ = 12*4kB\  + \ 2^{10} * 4kB \ + \ 2^{10} * 2^{10} * 4kB$

$= 4.00395 \  GB \simeq 4 \ GB$

Hence $4GB$ is the correct answer
edited by
12 votes
12 votes
Disk block size $= 4$ KB $= 2^{12}$ Bytes

Disk block address $= 32$ bits $= 4$ Bytes $= 2^2$ Bytes

No of addresses in a block $= 2^{12}/ 2^2 = 2^{10}$

Maximum file size $= (20 + 2^{10} + (2^{10})^2)* 2^{12} = X$

$= X / 2^{30}$ GB

$= 4.0$ GB
edited by
4 votes
4 votes
1GB = $2^{30}B$

DB = Disk Block

DBA length or size = 32 bits

= 4 B

#DBAs that can be stored per DB = DB size/ DBA size

= $\frac{2^{12}}{2^2}$

= $2^{10}$

TOTAL file size

= $(\#DirectPtr + \sum_i(\#Ptr_i * \#DBAs)^{i} )  * DB size$

Where i = indirectionLevel (single = 1, double = 2, etc)

Each direct pointer points to a single DB and for indirect pointer it depends on the indirectionLevel (single, double, triple or etc) to point to that many DBs. Thus we get max file size by multiplying total DB pointers with DBsize.

= $(12 + \sum (1*2^{10})^1 \ + (1*2^{10})^2 )*2^{12}\ B$

=$4. 004\ GB$ or

= 4.0(ANS)
edited by
1 votes
1 votes
Simple calculation –  

= 4GB+ 4MB + 48KB

To convert everything into GB we have to multiply by 1/1GB which is (1 / 1024*1024*1024) B

So, 4MB = 4 * 1024 * 1024 B and now into 4 *1024 * 1024 / 1024 * 1024 * 1024

4MB = (4 / 1024) GB = 0.00390625 GB

48 KB = 48 * 1024 / 1024 * 1024 * 1024 = 48 / 1024 * 1024 = 0.0000457763671875 GB

Maximum possible file size = 4GB + 0.00390625 GB +

0.0000457763671875 GB

= 4.00395 GB ≃4 GB
Answer:

Related questions

40 votes
40 votes
4 answers
1
20 votes
20 votes
4 answers
2
26 votes
26 votes
4 answers
3
Arjun asked Feb 7, 2019
19,284 views
Consider the following matrix:$R = \begin{bmatrix} 1 & 2 & 4 & 8 \\ 1 & 3 & 9 & 27 \\ 1 & 4 & 16 & 64 \\ 1 & 5 & 25 & 125 \end{bmatrix}$The absolute value of the product ...