edited by
21,021 views
45 votes
45 votes

A file system with $300$ GByte disk uses a file descriptor with $8$ direct block addresses, $1$ indirect block address and $1$ doubly indirect block address. The size of each disk block is $128$ Bytes and the size of each disk block address is $8$ Bytes. The maximum possible file size in this file system is

  1. $3$ KBytes
  2. $35$ KBytes
  3. $280$ KBytes
  4. ​​​​​​​dependent on the size of the disk
edited by

2 Answers

Best answer
69 votes
69 votes

Direct block addressing will point to $8$ disk blocks $= 8 \times 128 \ B = 1 \ KB$

Singly Indirect block addressing will point to $1$ disk block which has $128/8$ disc block addresses $= (128/8) \times 128 \ B = 2 \ KB$

Doubly indirect block addressing will point to $1$ disk block which has $128/8$ addresses to disk blocks which in turn has $128/8$ addresses to disk blocks  $= 16 \times 16 \times 128 \ B= 32 \ KB$

Total $= 35 \ KB$

Answer is (B).

edited by
64 votes
64 votes

Here, 8 direct disk block address:

means, you have 8 addresses which are pointing to 8 disk blocks. So, with this 8 direct DBA you are getting = 8*128 bytes (no of disk blocks * size of disk block)

1 indirect disk block address:

means, you have a disk block, in which only disk block addresses are there and each of the DBA is pointing to disk block. therefore you need to find how many DBA you can store in 1 disk block. which are,

no of address in 1 block = (Disk block size) / Disk block address in bytes

here, it is 128/8 = 16 address in 1 block and each is pointing to one disk block. therefore with this 1 indirect block address you are getting  16*128 Bytes

doubly indirect block address:

means, you have a disk block in which disk block addresses are there(same like singly indirect). but now these blocks have again only address of next level disk blocks. which are same as you got in singly indirect. therefore with doubly indirect 16*16*128 bytes.

total:

therefore maximum space = maximum file size = direct + singly + doubly

= (8*128) + (16*128) + (16*16*128)

= 1024B + 2048B + 32768B

=35840 Bytes

=35 Kbytes

Answer:

Related questions

47 votes
47 votes
6 answers
3
Arjun asked Sep 26, 2014
19,583 views
Consider the $3$ processes, $P1, P2$ and $P3$ shown in the table. $$\small \begin{array}{|c|c|c|} \hline \textbf{Process} & \textbf{Arrival Time} & \textbf{Time Units Req...
34 votes
34 votes
4 answers
4
gatecse asked Aug 5, 2014
12,947 views
A process executes the codefork(); fork(); fork();The total number of child processes created is$3$$4$$7$$8$