• retagged by
36,331 views
40 40 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

6 Answers

Best answer
66 66 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
17 17 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
9 9 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 1 vote
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
0 0 votes
inode: Inode(index node) is a data structure that contains all metadata(including data block(s) pointer) of a file.

  Block Size = 4KB

  Block address = 4B

  # of block pointers in a block = 2^12/2^2 = 2^10

  Total data block pointers  = 12+2^10+2^10*2^10

  Maximum possible file size = (12+2^10+2^20)*2^12

                             = 4299210752/2^30

                             = 4.00395202637 GB
0 0 votes
Given disk block size=4KB = 2^12 B

disk block address= 32 bits = 4 B

Now number of entries in one block (require when we use indirect pointers) = 2^12 B/4B = 2^10 entries

So there are 2^10 entries in one block

wrt Single Indirect pointer, file size = 12*4KB

wrt Indirect pointer, file size = 2^10 * 4KB

wrt Double indrect pointer, file size = 2^10*2^10*4KB

So Maximum file size is the summation of all of these:

=(12+2^10+2^10*2^10)*4KB

=1048588*2^10 B

=4 GB approx(after rounding off to 1 decimal place)

 
Answer:
Position:
Show:

Related questions

77 77 votes
6 answers 6 answers
48.0k
48.0k views
Arjun asked Feb 7, 2019
47,978 views
Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below:$$\begin{array}{|c|c|c|c|c|} \h...
46 46 votes
11 answers 11 answers
29.5k
29.5k views
Arjun asked Feb 7, 2019
29,530 views
The following C program is executed on a Unix/Linux system :#include<unistd.h int main() { int i; for(i=0; i<10; i++) if(i%2 == 0) fork(); return 0; }The total number of ...
48 48 votes
7 answers 7 answers
31.1k
31.1k views
Arjun asked Feb 7, 2019
31,069 views
Consider three concurrent processes $P_1, P_2$ and $P_3$ as shown below, which access a shared variable $D$ that has been initialized to $100.$ $$\begin{array}{|c|c|c|} \...
115 115 votes
12 answers 12 answers
40.0k
40.0k views
Arjun asked Feb 7, 2019
39,979 views
Assume that in a certain computer, the virtual addresses are $64$ bits long and the physical addresses are $48$ bits long. The memory is word addressible. The page size i...