A file system allocates storage in blocks of 4 KB. A file contains 10000 bytes and requires an integer number of blocks. Assuming 1 KB = 1024 bytes and no compression, how many bytes are allocated, and how much space is unused in the final block?

Options

  • A. 12288 bytes allocated and 2288 bytes unused
  • B. 10000 bytes allocated and 0 bytes unused
  • C. 16384 bytes allocated and 6384 bytes unused
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

A. 12288 bytes allocated and 2288 bytes unused

Detailed Explanation

Correct Answer: 12288 bytes allocated and 2288 bytes unused.

Explanation: Each block contains 4 × 1024 = 4096 bytes. The file requires ceiling(10000 / 4096) = 3 blocks. Total allocated space = 3 × 4096 = 12288 bytes. Unused space in the final block = 12288 - 10000 = 2288 bytes. This assumes the file is allocated exactly three whole blocks.