GATE / CS ARCHIVE

GATE CSE 2004 / QUESTION 49

Exact inode addressing capacity

Operating Systems · File Systems · Full GATE CSE 2004 paper

GATE 2004, Q49 2 marks · MCQ
Report issue

File Systems

Question 49, GATE 2004: A Unix-style inode has 10 direct pointers and one each single-, double- and triple-indirect pointer. Blocks are 1 Kbyte, block addresses are 32 bits, and integers are 48 bits. What is the maximum file size? Use 1 Kbyte=1024 bytes; alternatives are powers of two, not exact inode totals.
Options:
(A) 2^24 bytes
(B) 2^32 bytes
(C) 2^34 bytes
(D) 2^48 bytes
Question 49, GATE 2004: A Unix-style inode has 10 direct pointers and one each single-, double- and triple-indirect pointer. Blocks are 1 Kbyte, block addresses are 32 bits, and integers are 48 bits. What is the maximum file size? Use 1 Kbyte=1024 bytes; alternatives are powers of two, not exact inode totals.
Options:
(A) 2^24 bytes
(B) 2^32 bytes
(C) 2^34 bytes
(D) 2^48 bytes
Tap to enlarge
Your answer
Answer & solution

Answer: 17,247,250,432 bytes; C only as a power-of-two approximation (no official key was published)

1. A1KiB indirect block holds 1024/4=256 addresses. The inode can reference 10+256+256²+256³=16,843,018 data blocks, totaling 17,247,250,432 bytes.

2. The32-bit block-address space and 48-bit integer bound are both larger and do not constrain this total. The dominant triple-indirect contribution alone is 256³×1024=234 bytes, option C, but the exact maximum includes direct, single-indirect and double-indirect blocks and exceeds 234 by 67,381,248 bytes.

3. Thus no offered power-of-two option is exactly the stated maximum; C is the usual scale approximation, not an exact equality.

4. Teaching check: Indirect blocks contain addresses, so divide 1024 bytes by four bytes per address before exponentiating. The triple-indirect branch contributes 256³ data blocks; it does not replace the smaller branches. Distinguish exact capacity from the dominant-power approximation offered by the choices.

Original paper, page 7