A file system with 300 GB uses a file descriptor with 8 direct block…
A file system with 300 GB 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 256 Bytes and the size of each disk block address is 16 Bytes. The maximum possible file size in this file system is _____ KB?
Answer: 70 — Key idea: compute data bytes contributed by direct, single indirect, and double indirect addresses. Direct addresses: there are 8 direct block addresses, each…
Attempted by 245 students.
Show answer & explanation
Correct answer: 70
Key idea: compute data bytes contributed by direct, single indirect, and double indirect addresses.
Direct addresses: there are 8 direct block addresses, each data block is 256 Bytes, so direct data = 8 × 256 = 2048 Bytes.
Single indirect: one indirect block contains block addresses. Number of addresses per block = 256 / 16 = 16. Data from single indirect = 16 × 256 = 4096 Bytes.
Double indirect: one doubly indirect block contains 16 pointers to indirect blocks, and each indirect block contains 16 pointers to data blocks, so total data blocks = 16 × 16 = 256. Data from double indirect = 256 × 256 = 65536 Bytes.
Total file size = 2048 + 4096 + 65536 = 71680 Bytes.
Answer: 70 KB (since 71680 / 1024 = 70).
Note: the stated filesystem capacity (300 GB) is much larger than this inode-based limit, so the maximum file size here is limited by the inode addressing structure to 70 KB.