Computer Sciences > GATE 2026 SET-2 > Operating System
To keep track of free blocks in a file system, one of the two approaches is generally
used – using bitmaps (bit vectors) or using linked lists. Consider that the linked list
approach is used to keep track of free blocks in a file system. Assume that the disk
size is 16 GB, block size is 2 KB, and block numbers used are 32-bit long. A single
pointer of size 4 bytes is used in each block of the list to point to the next block of
the list. The number of blocks required to hold the free disk block numbers is
____________. (answer in integer)
Note: 1K=210 and 1G=230
Correct : 16,384
The correct answer is 16,384.
Total disk blocks: Disk size = 16 GB = 234 bytes. Block size = 2 KB = 211 bytes. Total blocks = 234 / 211 = 223 = 8,388,608 blocks.
Entries per list block: Each list block = 2048 bytes. Each block number = 4 bytes. One pointer (4 bytes) per list block points to the next list block. Usable entries per list block = (2048 − 4) / 4 = 2044 / 4 = 511 block numbers.
Number of list blocks needed: = ceil(223 / 511) = ceil(16,416.06) = 16,417 blocks.
If the pointer is assumed to not reduce usable entries (a simpler interpretation): entries per block = 2048 / 4 = 512, and blocks needed = 223 / 29 = 214 = 16,384.
Similar Questions
Consider the following five disk five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given tim...
Which one of the following CPU scheduling algorithms cannot be preemptive?
Consider three processes P1, P2, and P3 running identical code, as shown in the
pseudocode below. A and B are two binary semaphores initialized to 1 and 0,...
Total Unique Visitors
Loading......