CS FundamentalsVery hardGATE CS
A file uses an inode with 12 direct pointers, then single-, double- and triple-indirect pointers; blocks are 4 KB with 4-byte pointers. The inode is already in memory but no other block is cached. How many disk reads are needed to read the single byte at offset 5 MB into the file?
- A. 3
- B. 2
- C. 4
- D. 1
Correct answer: A. 3
Direct blocks cover 48 KB and single-indirect another 1024 × 4 KB = 4 MB (up to 4 MB + 48 KB). Offset 5 MB lies in the double-indirect range: read the double-indirect block, then a single-indirect block, then the data block: 3 reads.
More Operating Systems questions
- A disk of 64 GB uses 8 KB clusters and FAT32-style entries of 4 bytes per cluster. How big is one copy of the FAT?
- A 2 TB disk with 4 KB blocks tracks free space with a bitmap (one bit per block). How large is the bitmap?
- A file of 100 blocks uses linked allocation (each block holds a pointer to the next). No blocks are cached and the directory entry gives…
- A 200-block file is stored with contiguous allocation and there is no free space after it, but enough before it. The file control block is…
- Four identical 2 TB disks are combined. What usable capacity do RAID 0, RAID 1+0 (striped mirrors) and RAID 5 give, respectively?
- In a 5-disk RAID 5 array, a small write updates a single data block. Using the read-modify-write method, how many disk I/O operations does…