ITPEC FE Morning April 2019 Question 12
There exists a storage system in which one (1) block is composed of eight (8) sectors of 500 bytes each, and the storage area is block-wise allocated to the files. When a 2,000-byte file and 9,000-byte file are to be saved, what is the total number of sectors that is allocated to these two (2) files? Here, the sectors that are occupied by the directory information and other such management information can be ignored.
Explanation
32 sectors — space is allocated in whole blocks, so round each file up to whole blocks before converting to sectors.
- •Block size: 8 × 500 = 4,000 bytes
- •2,000-byte file: 2,000 ÷ 4,000 = 0.5, rounded up to 1 block = 8 sectors
- •9,000-byte file: 9,000 ÷ 4,000 = 2.25, rounded up to 3 blocks = 24 sectors
- •Total: 8 + 24 = 32 sectors
Answer (d)
Why not others:
- •(a) 22 — allocates by sector instead of block: 4 + 18 = 22
- •(b) 26 — rounds only the small file up to a block: 8 + 18 = 26
- •(c) 28 — rounds only the large file up to blocks: 4 + 24 = 28
Key rule: With block-wise allocation, each file occupies the ceiling of (file size ÷ block size) whole blocks, even if the last block is mostly empty; round per file, not over the total.
Computer Component · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.