In a particular Unix OS, each data block is of size 1024 bytes, each node has…

2004

In a particular Unix OS, each data block is of size 1024 bytes, each node has 10 direct data block addresses and three additional addresses: one for single indirect block, one for double indirect block and one for triple indirect block. Also, each block can contain addresses for 128 blocks. Which one of the following is approximately the maximum size of a file in the file system?  

  1. A.

    512 MB

  2. B.

    2GB

  3. C.

    8GB

  4. D.

    16GB

Attempted by 48 students.

Show answer & explanation

Correct answer: B

Key idea: count all data blocks reachable through direct, single, double and triple indirect addresses, then multiply by the block size.

  • Block size = 1,024 bytes.

  • Direct blocks = 10 → 10 data blocks.

  • Single indirect = 128 addresses → 128 data blocks.

  • Double indirect = 128 × 128 = 16,384 data blocks.

  • Triple indirect = 128^3 = 2,097,152 data blocks.

  • Total data blocks = 10 + 128 + 16,384 + 2,097,152 = 2,113,674 blocks.

  • Total bytes = 2,113,674 × 1,024 = 2,164,402,176 bytes ≈ 2.016 GiB (about 2.16 billion bytes).

  • Conclusion: The maximum file size is approximately 2 GB.

Explore the full course: Gate Guidance By Sanchit Sir