All Exams Test series for 1 year @ ₹349 only
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 cyclinder-wise and the addressing format is <cylinder no., surface no., sector no.>. A file of size 42797KB is stored in the disk and the starting disk location of the file is <1200,9,40>. What is cylinder number of the last sector of the file, if it is stored in a contiguous manner?

The correct answer is

1284

Disk Parameters and File Details

We are given information about a hard disk and a file stored on it. Let's list the key parameters:

  • Number of recording surfaces: 16 (numbered 0-15)
  • Number of cylinders: 16384 (numbered 0-16383)
  • Sectors per cylinder (track): 64 (numbered 0-63)
  • Data storage capacity per sector: 512 Bytes
  • File size: 42797 KB
  • Storage method: Contiguous (sectors are filled one after another without gaps)
  • Starting disk location: <1200, 9, 40> (Cylinder 1200, Surface 9, Sector 40)

The goal is to find the cylinder number where the file's last sector is stored.

Calculating Total Sectors Needed for the File

To find the final location, we first calculate the total number of sectors the file requires. We need to convert the file size from Kilobytes (KB) to Bytes and then divide by the capacity of each sector.

File size in Bytes = $42797 \text{ KB} \times 1024 \frac{\text{Bytes}}{\text{KB}} = 43824128 \text{ Bytes}$

The capacity per sector is given as 512 Bytes.

Total sectors needed = $\frac{\text{File Size in Bytes}}{\text{Capacity per Sector}} = \frac{43824128}{512} = 85594 \text{ Sectors}$

So, the file occupies a total of 85594 sectors.

Calculating Disk Geometry Factors

We also need to know the total number of sectors that fit into a single cylinder. This helps us map the file's progression across cylinders.

Sectors per cylinder = Sectors per track $\times$ Number of surfaces

Sectors per cylinder = $64 \times 16 = 1024 \text{ Sectors/Cylinder}$

Tracking the Contiguous File Placement

The file starts its storage at Cylinder 1200, Surface 9, Sector 40. Because the storage is contiguous, we follow the sequence of sectors.

First, let's calculate how many sectors are used on the specific starting track (Surface 9 in Cylinder 1200). Sectors on a track are numbered 0 to 63.

Sectors used on starting track = Total sectors on track - Starting sector number

Sectors used on starting track = $64 - 40 = 24 \text{ Sectors}$

These 24 sectors are the first part of the file we are storing.

Now, we calculate how many sectors are still left to be stored after filling these initial sectors on the starting track.

Remaining sectors = Total sectors needed - Sectors used on starting track

Remaining sectors = $85594 - 24 = 85570 \text{ Sectors}$

Determining the Cylinder Number of the Last Sector

The remaining 85570 sectors will fill up the rest of Cylinder 1200 (specifically, Surfaces 10 through 15) and then proceed to subsequent cylinders.

To find out which cylinder the last sector falls into, we can calculate how many full cylinders are needed for these remaining sectors. Remember, each cylinder holds 1024 sectors.

Number of full cylinders required = $\lfloor \frac{\text{Remaining sectors}}{\text{Sectors per cylinder}} \rfloor$

Number of full cylinders required = $\lfloor \frac{85570}{1024} \rfloor = \lfloor 83.5625 \rfloor = 83 \text{ Cylinders}$

This means that after the initial 24 sectors on Cylinder 1200, Surface 9, there are 83 more cylinders that will be completely filled with file data. These cylinders start immediately after the initial cylinder where the file began. So, they include cylinders 1201, 1202, ..., up to cylinder $1200 + 83 = 1283$. This confirms that Cylinder 1283 is completely filled by the file data.

Let's calculate the total number of sectors stored in these 83 full cylinders:

Sectors in 83 cylinders = $83 \times 1024 = 84992 \text{ Sectors}$

Now, we find out how many sectors are still left to be stored after filling these 83 full cylinders.

Sectors left for the final cylinder = Remaining sectors - Sectors in 83 cylinders

Sectors left = $85570 - 84992 = 578 \text{ Sectors}$

These remaining 578 sectors need to be placed in the next available cylinder. Since Cylinder 1283 was the last full cylinder used by the file, the next cylinder in sequence is 1284.

Therefore, the last sector of the file, which is the 85594th sector overall, is located in cylinder number 1284.

Was this answer helpful?

Important Questions from Computer OS

  1. Windows 10 is a/an:

  2. A hard disk has a rotational speed 6000 rpm. Its average latency time is

  3. In operating systems, what is the full form of RAG?

  4. Which of the following can make the application program, hardware independent?

  5. Which OSI layer is concerned with reliable end to end delivery of data?

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App