A file system with 300 Gbyte disk uses a file descriptor with 8 direct block…

2012

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. A.

    3 Kbytes

  2. B.

    35 Kbytes

  3. C.

    280 Bytes

  4. D.

    Dependent on the size of the disk

Attempted by 120 students.

Show answer & explanation

Correct answer: B

Given data:

  • Block size = 128 bytes

  • Address (pointer) size = 8 bytes

  • File descriptor contains 8 direct block addresses, 1 single indirect pointer, and 1 double indirect pointer

Step 1: Calculate how many block addresses fit in one block:

Addresses per block = 128 / 8 = 16 addresses per block

Step 2: Compute data covered by each pointer type:

  1. Direct blocks: 8 × 128 B = 1024 B = 1 KB

  2. Single indirect: one pointer block holds 16 addresses → 16 × 128 B = 2048 B = 2 KB

  3. Double indirect: double indirect points to 16 indirect blocks each with 16 addresses → 16 × 16 × 128 B = 32768 B = 32 KB

Total maximum file size = 1 KB + 2 KB + 32 KB = 35 KB

Answer: 35 KB

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir