Skip to content
Official PYQ · 2013

GATE CS 2013 Q29 — File Systems

Explain with AI

Consider a hard disk with 1616 recording surfaces (0−15)(0-15) having 1638416384 cylinders (0−16383)(0-16383) and each cylinder contains 6464 sectors (0−63)(0-63). Data storage capacity in each sector is 512512 bytes. Data are organized cylinder-wise and the addressing format is ⟨cylinder no.,surface no.,sector no.⟩\langle \text{cylinder no.}, \text{surface no.}, \text{sector no.} \rangle . A file of size 4279742797 KB is stored in the disk and the starting disk location of the file is ⟨1200,9,40⟩\langle 1200, 9, 40\rangle. What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?

Choose one option
View worked solution

Answer: D

To find the cylinder number of the last sector of the file, we first calculate the total number of sectors required for the file and then determine their physical layout on the disk.

1. Calculate the number of sectors required:

  • File size = 42797 KB42797 \text{ KB}
  • Sector capacity = 512 bytes=0.5 KB512 \text{ bytes} = 0.5 \text{ KB}
  • Total sectors required = 427970.5=85594 sectors\frac{42797}{0.5} = 85594 \text{ sectors}

2. Calculate the capacity of one cylinder:

  • Sectors per cylinder = 16 surfaces×64 sectors/surface=1024 sectors16 \text{ surfaces} \times 64 \text{ sectors/surface} = 1024 \text{ sectors}

3. Determine the distribution of sectors:

  • The file starts at ⟨1200,9,40⟩\langle 1200, 9, 40\rangle.
  • Sectors already used in cylinder 12001200 before the start of the file = 9 surfaces×64 sectors+40 sectors=616 sectors9 \text{ surfaces} \times 64 \text{ sectors} + 40 \text{ sectors} = 616 \text{ sectors} (numbered 00 to 615615).
  • Sectors remaining in cylinder 12001200 = 1024−616=4081024 - 616 = 408 sectors.
  • Sectors left to be stored in subsequent cylinders = 85594−408=8518685594 - 408 = 85186 sectors.

4. Find the final cylinder:

  • Number of full cylinders occupied after cylinder 12001200 = ⌊851861024⌋=83\lfloor \frac{85186}{1024} \rfloor = 83 cylinders (which are cylinders 12011201 to 12831283).
  • Remaining sectors = 85186−(83×1024)=19485186 - (83 \times 1024) = 194 sectors.

These remaining 194194 sectors will be stored in the next cylinder, which is cylinder 12841284.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore File Systems questions