• edited by
31,848 views
65 65 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

4 Answers

Best answer
89 89 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
82 82 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

1 1 vote

The number of block addresses that can be stored inside a single index block is found by dividing the block size by the size of each address:

$$N = \frac{128 \text{ Bytes}}{8 \text{ Bytes}} = 16 \text{ addresses}$$

The 8 direct block addresses point directly to 8 individual data blocks on the disk.

The 1 indirect block address points to an index block that can hold a maximum of 16 direct block pointers:

$$\text{Indirect Blocks} = 1 \times 16 = 16 \text{ blocks}$$

The 1 doubly indirect block address points to an index block where each entry links to another level of index blocks, creating a nested grid of pointers:

$$\text{Doubly Indirect Blocks} = 1 \times 16 \times 16 = 256 \text{ blocks}$$

Summing up all the blocks that can be linked under this file descriptor structure gives the total number of addressable data blocks:

$$\text{Total Blocks} = 8 + 16 + 256 = 280 \text{ blocks}$$

The maximum possible file size is calculated by multiplying this total addressable block count by the capacity of a single data block:

$$\text{Maximum File Size} = 280 \text{ blocks} \times 128 \text{ Bytes/block} = 35840 \text{ Bytes}$$

Converting this capacity from raw bytes into KBytes by dividing by 1024 yields the final limit:

$$\text{Maximum File Size} = \frac{35840}{1024} \text{ KBytes} = 35 \text{ KBytes}$$

Correct Option: B

0 0 votes
\[
8 \times 128 + 2^{4} \times 128 + 2^{8} \times 128
\]

\[
2^{10} + 2^{11} + 2^{15} = 35\ \text{KB}
\]
ago
Answer:
Position:
Show:

Related questions

37 37 votes
4 answers 4 answers
16.9k
16.9k views
Arjun asked Sep 29, 2014
16,946 views
Consider the virtual page reference string$$\text{1, 2, 3, 2, 4, 1, 3, 2, 4, 1}$$on a demand paged virtual memory system running on a computer system that has main memory...
179 179 votes
15 answers 15 answers
51.3k
51.3k views
gatecse asked Sep 26, 2014
51,291 views
Fetch_And_Add(X,i) is an atomic Read-Modify-Write instruction that reads the value of memory location $X$, increments it by the value $i$, and returns the old value of $X...
82 82 votes
9 answers 9 answers
33.7k
33.7k views
Arjun asked Sep 26, 2014
33,729 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...
68 68 votes
7 answers 7 answers
18.2k
18.2k views
go_editor asked Apr 21, 2016
18,216 views
Consider the following C code segment.int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf(“ \n %d %d ”, a, b); ...