Computer Sciences > GATE 2025 SET-1 > File Systems
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=210 and 1M=220. The amount of space in bytes that will be wasted due to internal fragmentation is ______ (Answer in integer)
Correct : 65468
Block size = 64K = 65536 bytes. Each block uses 4 bytes for a pointer, leaving 65532 bytes of usable data per block.
File size = 1M = 1048576 bytes. Number of blocks needed = ⌈1048576 ÷ 65532⌉ = ⌈16.0009...⌉ = 17 blocks.
Verification: 16 full blocks hold 16 × 65532 = 1048512 bytes of data. The remaining 1048576 − 1048512 = 64 bytes go into the 17th block.
In the 17th block: 64 bytes of file data + 4 bytes for the NULL pointer = 68 bytes used. The rest of the block = 65536 − 68 = 65468 bytes is completely empty and wasted — this is the internal fragmentation.
Correct answer: 65468
Similar Questions
A palindrome is a word that reads the same forwards and backwards. In a game
of words, a player has the following two plates painted with letters.
From...
Which number does not belong in the series below?
2, 5, 10, 17, 26, 37, 50, 64
Choose the word that is opposite in meaning to the word “coherent”.
Total Unique Visitors
Loading......