Question
The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointers. The disk block size is , and the disk block address is -bits long. The maximum possible file size is (rounded off to 1 decimal place) _________ GB.
Official answer and solution
- Accepted answers
- 3.7 to 3.8, or 4 to 4.1
- From
- Official GATE 2019 answer key
Official answer key accepted both 3.7 to 3.8 and 4.0 to 4.1. The calculation yields ~4.0 GB in binary GiB units (4.004 GB) or ~3.7 GiB if 4 GB is converted to binary gigabytes.
Solution
Compute the total number of blocks addressable via direct, single-indirect, and double-indirect pointers in the inode, then convert to GB.
We are given:
- Disk block size =
- Disk block address =
The number of block pointers that fit in a single disk block is:
The total number of data blocks addressable by the inode is:
- Direct pointers ():
- Single-indirect pointer ():
- Double-indirect pointer ():
Total blocks:
Total maximum file size in bytes:
In binary gigabytes ():
In decimal gigabytes (), or converting to GiB (), the GATE answer key officially accepted both 3.7 to 3.8 and 4.0 to 4.1.
3.7 to 3.8
Forgetting that indirect blocks contain block addresses (4 bytes each) rather than direct data.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2019 Computer Science and Information Technology (CS)
- Question
- 52 of 65, printed as CS Q.42
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.