GATE - 2013 | OS | Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders

GATE - 2013 | OS | Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders
Posted on 12-02-2022

GATE - 2013 [Operating System]

Question:

Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders (0-16383) and each cylinder contains 64 sectors (0-63). Data storage capacity in each sector is 512 bytes. Data are organized cylinder-wise and the addressing format is <cylinder no., surface no., sector no.>. A file of size 42797 KB is stored in the disk and the starting disk location of the file is <1200, 9, 40>. What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?

A

1281

B

1282

C

1283

D

1284

  

Solution:

Option (D) is Correct.

It is given that we have 16 recording surfaces and 16384 cylinders, each cylinder contains 64 sectors and starting address is <1200, 9, 40>.

The capacity of each sector is 512Bytes.


Suppose we have x cylinders & in each cylinder, we have 16 surface and 64 sectors so we need to store 42797 KB of data.


x * 16* 64 *512 + 16*64* 512 + 64* 512 = 42797 KB , by solving this we get x = 82.5 so we need 83 cylinders.


We can add this to the no. of cylinders in the starting address <1200, 9 ,40 >, i.e. 1200, but we also need to cover 40 more sectors which will need one more cylinder, this cylinder is not full but still it has to be accommodated.


Hence 1200+83+1 = 1284 and currently we will be on 1284 cylinder.

Thank You