4.practice Questions and Solutions Set-4
4.practice Questions and Solutions Set-4
(File systems)
[Updated : 11/Sep/2020]
1) Consider a disk queue with requests for cylinders 98, 183, 41, 122, 14, 124, 65, 67. The
FCFS scheduling algorithm is used. The head is initially at cylinder number 53. The cylinders
are numbered from 0 to 199. The total head movements or the seek operations (in number of
cylinders) incurred while servicing these requests is _______.
2) Consider a disk queue with requests for cylinders 981, 183, 401, 122, 104, 324, 565, 267.
The FCFS scheduling algorithm is used. The head is initially at cylinder number 553. The
cylinders are numbered from 0 to 999. The total head movements or the seek operations (in
number of cylinders) incurred while servicing these requests is _______.
3) Consider a disk queue with requests for cylinders 55, 58, 39, 18, 90, 160, 150, 38, 184. The
C-SCAN scheduling algorithm is used. The head is initially at cylinder number 100, moving
towards last cylinder. The cylinders are numbered from 0 to 199. The average seek length is
_______.
5) Consider a disk queue with requests for cylinders 55, 58, 39, 18, 90, 160, 150, 38, 184. The
SSTF scheduling algorithm is used. The head is initially at cylinder number 100, moving towards
last cylinder. The cylinders are numbered from 0 to 199. The average seek length is _______.
6) Consider a disk queue with requests for cylinders 55, 58, 39, 18, 90, 160, 150, 38, 184. The
FCFS scheduling algorithm is used. The head is initially at cylinder number 100, moving towards
last cylinder. The cylinders are numbered from 0 to 199. The average seek length is _______.
7) Consider a disk queue with requests for cylinders 82,170,43,140,24,16,190. The LOOK
scheduling algorithm is used. The head is initially at cylinder number 50. The cylinders are
numbered from 0 to 199. The total head movements or the seek operations (in number of
cylinders) incurred while servicing these requests is _______.
8) Consider a disk queue with requests for cylinders 98, 183, 41, 122, 14, 124, 65, 67. The
CLOOK scheduling algorithm is used. The head is initially at cylinder number 53. The cylinders
are numbered from 0 to 199. The total head movements or the seek operations (in number of
cylinders) incurred while servicing these requests is _______.
9) Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is
given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is on
track 50. The distance that will be traversed by the R/W head when the Shortest Seek Time
First (SSTF) algorithm and the SCAN (Elevator) algorithm (assuming that SCAN algorithm
moves towards 100 when it starts execution) is _________ and _______, respectively.
10) Consider a file system with 1MB block size. Assume an inode of a file holds pointers to D
direct data blocks, and a pointer to a single indirect block. Further, assume that the single
indirect block can hold pointers to I other data blocks. What is the maximum file size that can be
supported by such an inode design?
11) Consider a FAT file system where disk is divided into B byte blocks, and every FAT entry
can store an N bit block number. What is the maximum size of a disk partition that can be
managed by such a FAT design?
12) Consider a secondary storage system of size 2 TB, with 512-byte sized blocks. Assume that
the filesystem uses a multilevel inode to track data blocks of a file. The inode has 64 bytes of
space available to store pointers to data blocks, including a single indirect block, a double
indirect block, and several direct blocks. What is the maximum file size that can be stored in
such a file system?
Solution : Contiguous allocation : You can think it as array of blocks, hence we directly index
into N th block. So only 1 block access is needed
Linked allocation : It is linked list, to access an N th block we do N traversals. So N block
accesses are needed.
Indexed allocation : One access for Inode + One access for Block = 2.
14) Suppose a computer has a file system for a 128GB disk, where each disk block is 8KB. If
the OS for this computer uses a FAT, what is the smallest amount of memory that could
possibly be used for the FAT (assuming the entire FAT is in memory)?
Solution : 48MB
Solution : 504MB.