243 views
4 4 votes

An inode-based file system uses $4$ KB blocks and $4$-byte disk addresses. The inode contains $12$ direct block pointers, $1$ single indirect pointer, and $1$ double indirect pointer.

Which of the following statements is/are TRUE regarding this file system?

  1. THE MAXIMUM FILE SIZE SUPPORTED IS SLIGHTLY MORE THAN $4$ GB.
     
  2. THE MAXIMUM FILE SIZE SUPPORTED IS SLIGHTLY MORE THAN $1$ GB.
     
  3. ACCESSING A BYTE AT OFFSET $20$ MB REQUIRES AT MOST $3$ DISK BLOCK READS (INCLUDING THE INODE).
     
  4. A SINGLE INDIRECT BLOCK CAN ADDRESS UP TO $1024$ DATA BLOCKS.

1 Answer

1 1 vote

Block size $=4 \mathrm{~KB}$

Pointers per block $=\frac{4 \mathrm{~KB}}{4 \text { bytes }}=1024$ pointers

Direct: $12 \times 4 \mathrm{~KB}=48 \mathrm{~KB}$

Single Indirect: $1024 \times 4 \mathrm{~KB}=4 \mathrm{MB}$

Double Indirect: $1024 \times 1024 \times 4 \mathrm{~KB}=1024 \times 4 \mathrm{MB}=4 \mathrm{~GB}$

Total Size: $48 \mathrm{~KB}+4 \mathrm{MB}+4 \mathrm{~GB} \approx 4 \mathrm{~GB}$

(A) THE MAXIMUM FILE SIZE SUPPORTED IS SLIGHTLY MORE THAN $\mathbf{4}$ GB: TRUE. The total is $4 \mathrm{~GB}+4 \mathrm{MB}+48 \mathrm{~KB}$.

(B) THE MAXIMUM FILE SIZE SUPPORTED IS SLIGHTLY MORE THAN $\mathbf{1}$ GB: FALSE.

(C) ACCESSING A BYTE AT OFFSET $\mathbf{20}$ MB REQUIRES AT MOST 3 DISK BLOCK READS (INCLUDING THE INODE): FALSE.

  • $20$ MB is in the Double Indirect range (since Direct + Single Indirect only covers up to $\sim 4.04 \mathrm{MB}$ ).
     
  • Path: Inode → Double Indirect Block → First level Indirect Block → Data Block.
     
  • This requires $4$ reads $( 3$ disk blocks $+$ Inode$)$.
     

(D) A SINGLE INDIRECT BLOCK CAN ADDRESS UP TO $\mathbf{1024}$ DATA BLOCKS: TRUE.

Answer:
Position:
Show:

Related questions

3 3 votes
2 2 answers
326
326 views
GO Classes asked Feb 16
326 views
A system has $4$ copies of resource $R$. There are $n$ processes, and each process requires at most $2$ copies of resource $R$ to complete its execution.Which of the foll...
2 2 votes
1 1 answer
236
236 views
GO Classes asked Feb 16
236 views
Consider three concurrent processes $P_1, P_2$, and $P_3$ sharing a single counting semaphore $\verb|S|$ initialized to $\mathbf{2}$. Each process executes the following ...
2 2 votes
2 2 answers
249
249 views
GO Classes asked Feb 16
249 views
Consider three processes with the following CPU burst times: $P_1=2, P_2=7$, and $P_3=10$. All processes arrive at time $t=0$. The system uses Round Robin scheduling with...
4 4 votes
2 2 answers
280
280 views
GO Classes asked Feb 16
280 views
A computer system uses $\mathbf{32}$-bit virtual addresses. The system implements a two-level hierarchical paging scheme. The page size of the Outer Page Table is exactly...