The GATE Grind

GATE 2025 CS (CS1) – Question 51

Operating System · File Systems and Disk Performance · 2 marks · Numerical answer

A disk of size 512M bytes is divided into blocks of 64K bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves 4 bytes to store the pointer to the next data block. The link part of the last data block contains a $NULL$ pointer (also of 4 bytes). Suppose a file of 1M bytes needs to be stored in the disk. Assume, 1K = $2^{10}$ and 1M = $2^{20}$. The amount of space in bytes that will be wasted due to internal fragmentation is ______. (Answer in integer)

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 65468

Explanation

Each block holds 65536-4 = 65532 data bytes. 1048576/65532 needs 17 blocks. Data capacity is 17·65532 = 1114044, so the waste is 1114044-1048576 = 65468 bytes.