GATE / CS ARCHIVE

GATE CSE 2012 / QUESTION 41

Maximum file size with double indirection

Operating Systems · File Systems · Full GATE CSE 2012 paper

GATE 2012, Q41 2 marks · MCQ
Report issue

File Systems

Question 41, GATE 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
        (A) 3 KBytes
        (B) 35 KBytes
        (C) 280 KBytes
        (D) dependent on the size of the disk
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Each indirect block holds 128/8=16 addresses. The descriptor therefore reaches 8+16+16²=280 data blocks. Their payload is 280×128=35, 840 bytes=35 KiB (the option calls these KBytes). Indirection blocks are metadata and do not count as file payload. The 300 GByte disk is more than large enough. Hence B.

Check: The eight direct pointers cover 1024 bytes, the single-indirect pointer covers 16×128=2048 bytes, and double indirection covers 256×128=32768 bytes. Their sum is 35840 bytes. Multiplying 280 by KiB instead of by 128 bytes produces the 280-KByte distractor.

Original paper, page 10 · Answer key