File Systems · Operating System
12 questions · asked in 10 of 27 years (2000–2026)
MCQ 8 · NAT 41-mark 8 · 2-mark 4
2000Questions per year2026
Questions 1–5 of 12
A disk of size bytes is divided into blocks of bytes. A file is stored in the disk using 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 bytes needs to be stored in the disk. Assume, . The amount of space in bytes that will be wasted due to internal fragmentation is _________. (Answer in integer)
Answer: 65468
The disk block size bytes. With linked allocation, each block, the last one too, keeps bytes for the pointer to the next block. So the data space in one block bytes.
The file size bytes. Blocks needed: . Here , which is bytes less than the file size. So one more block is needed, the th block. The total is blocks.
Total disk space given to the file: bytes. Space that is used (the file data plus the -byte pointer in each of the blocks): bytes.
Space wasted by internal fragmentation: bytes.
Answer: 65468
The file size bytes. Blocks needed: . Here , which is bytes less than the file size. So one more block is needed, the th block. The total is blocks.
Total disk space given to the file: bytes. Space that is used (the file data plus the -byte pointer in each of the blocks): bytes.
Space wasted by internal fragmentation: bytes.
Answer: 65468
Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in
B. Now, consider inserting a new block in the middle of the file (between block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are and , respectively, then the value of is
Answer: 153
Contiguous (A): Blocks 51-100 each shift by one place. That is a read and a write for 50 blocks = 100 accesses. Writing the new block adds 1. .
Linked (B): Reach block 50 by following pointers = 50 reads. Write the new block, pointing to block 51 = 1. Rewrite the pointer of block 50 = 1. .
Answer: 153
Linked (B): Reach block 50 by following pointers = 50 reads. Write the new block, pointing to block 51 = 1. Rewrite the pointer of block 50 = 1. .
Answer: 153
The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointer The disk block size is 4 kB and the disk block addresses 32-bits long. The maximum possible file size is (rounded off to 1 decimal place) __________ GB.
Answer: 4 to 4.1
Number of pointers in one block = 4 KB / 4 B = 1024.
- Direct pointers: 12 4 KB = 48 KB
- Single indirect pointer: 1024 4 KB = 4 MB
- Double indirect pointer: 4 KB = 4 GB
Adding all three, total 4 GB + 4 MB + 48 KB 4.0 GB
Answer: 4.0
- Direct pointers: 12 4 KB = 48 KB
- Single indirect pointer: 1024 4 KB = 4 MB
- Double indirect pointer: 4 KB = 4 GB
Adding all three, total 4 GB + 4 MB + 48 KB 4.0 GB
Answer: 4.0
In a file allocation system, which of the following allocation schemes(s) can be used if no external fragmentation is allowed?
I. Contiguous
II. Linked
III. Indexed
I. Contiguous
II. Linked
III. Indexed
Answer: (D)
Contiguous allocation needs one large block of free space in one piece, so it leads to external fragmentation. Linked and indexed allocation can take free blocks from any place on the disk, so they do not have external fragmentation.
Answer: II and III only
Answer: II and III only
A FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is 4 bytes in size. Given a 100x bytes disk on which the file system is stored and data block size is bytes, the maximum size of a file that can be stored on this disk in units of bytes is _______.
Answer: 99.55 to 99.65
Count of blocks on the disk = . Each block gets one FAT entry.
Space taken by the FAT = bytes.
Largest file that can be stored = bytes.
Answer: 99.6
Space taken by the FAT = bytes.
Largest file that can be stored = bytes.
Answer: 99.6
Keep practising