A UNIX file system has 1 KB block size and 4-byte disk addresses. What is the…

2015

A UNIX file system has 1 KB block size and 4-byte disk addresses. What is the maximum file size if the inode contains ten direct block entries, one single indirect block entry, one double indirect block entry and one triple indirect block entry?

  1. A.

    30 GB

  2. B.

    64 GB

  3. C.

    16 GB

  4. D.

    1 GB

Attempted by 116 students.

Show answer & explanation

Correct answer: C

Solution:

  • Block size = 1 KB = 1024 bytes.

  • Disk address size = 4 bytes.

  • Pointers per indirect block = 1024 / 4 = 256.

  • Inode entries: ten direct blocks, one single indirect, one double indirect, one triple indirect.

  1. Direct blocks: 10 × 1 KB = 10 KB (10,240 bytes).

  2. Single indirect: 256 × 1 KB = 256 KB (262,144 bytes).

  3. Double indirect: 256^2 × 1 KB = 65,536 KB = 64 MiB (67,108,864 bytes).

  4. Triple indirect: 256^3 × 1 KB = 16,777,216 KB = 16 GiB (17,179,869,184 bytes).

Add all components (in bytes):

  • Direct: 10,240 bytes

  • Single indirect: 262,144 bytes

  • Double indirect: 67,108,864 bytes

  • Triple indirect: 17,179,869,184 bytes

Total bytes = 17,247,250,432 bytes.

In binary gigabytes (GiB, where 1 GiB = 2^30 bytes), this is about 16.06 GiB. The triple indirect term dominates, so the commonly reported answer is approximately 16 GB.

Therefore, the maximum file size (using the given block and address sizes and the inode structure) is approximately 17,247,250,432 bytes, commonly represented as 16 GB in the available choices.

Explore the full course: Mppsc Assistant Professor