G27
Self-checkedTier 2 17 min readcoa.secondary-storage-disk

Disk structure and access time

The hard disk as GATE models it: platters, surfaces, tracks, sectors and cylinders; capacity and the size of a sector address; converting between a (cylinder, surface, sector) address and a sector number; rotation, seek and transfer time; and why a contiguous file is read hundreds of times faster than the same sectors scattered.

Why it exists

A disk is where programs, files and databases live, and it is millions of times slower than memory. Reading one byte takes the same time as reading a whole track, because almost all of the time goes into moving the arm and waiting for the platter to turn. So GATE asks two kinds of questions: bookkeeping (how big is the disk, how many bits name a sector, which sector number is the address ⟨c, h, s⟩, in which cylinder does a file end) and timing (how long does it take to read one sector, a file of nn sectors, a file scattered over the disk). This page gives the model, the formulas and the traps. How the operating system orders the requests is on the disk scheduling page.

Prerequisites

The disk is the bottom level of the memory hierarchy: the largest, cheapest and slowest level.

Precise definitions

Structure. A disk has one or more platters on a common spindle that turns at a fixed speed in revolutions per minute (rpm). Each platter has two surfaces (a recording surface is one side). Each surface is divided into concentric tracks, each track into sectors, the smallest unit that can be read or written. One head per surface, all mounted on one arm, moves together; the tracks that the heads are over at one arm position form a cylinder.

  • tracks on one surface == number of cylinders CC; surfaces HH; sectors per track SS; bytes per sector BB;
  • tracks on the disk =C⋅H= C \cdot H; sectors =C⋅H⋅S= C \cdot H \cdot S;
  • capacity=C⋅H⋅S⋅B,track capacity=S⋅B.\text{capacity} = C \cdot H \cdot S \cdot B, \qquad \text{track capacity} = S \cdot B.

A question that gives the capacity asks for one unknown from this product (for example the number of cylinders =capacity/(H⋅S⋅B)= \text{capacity} / (H \cdot S \cdot B)).

Units. In GATE questions 1 KB=2101\,\text{KB} = 2^{10}, 1 MB=2201\,\text{MB} = 2^{20}, 1 GB=2301\,\text{GB} = 2^{30} bytes for sizes, but a transfer rate such as "50×10650 \times 10^6 bytes per second" is decimal as written. Convert before you divide.

Addresses. A sector is named by the triple ⟨c,h,s⟩\langle c, h, s \rangle (cylinder, surface, sector), each field counted from 00. Its sector number (position in the whole sequence) depends on how files are laid out. GATE uses the cylinder-wise layout: fill a track, then the next surface of the same cylinder (no arm movement), then the next cylinder:

n=(c⋅H+h)⋅S+s,c=⌊n/(HS)⌋,h=⌊n/S⌋ mod H,s=n mod S.n = (c \cdot H + h) \cdot S + s, \qquad c = \lfloor n / (H S) \rfloor, \quad h = \lfloor n / S \rfloor \bmod H, \quad s = n \bmod S.

A sector can be named by one number, needing ⌈log⁡2(CHS)⌉\lceil \log_2 (C H S) \rceil bits, or by the three fields, needing ⌈log⁡2C⌉+⌈log⁡2H⌉+⌈log⁡2S⌉\lceil \log_2 C \rceil + \lceil \log_2 H \rceil + \lceil \log_2 S \rceil bits. The two are equal when CC, HH and SS are powers of two and the second is larger otherwise; read which one the question asks for.

Time to access a sector.

Taccess=Tseek+Trot+Ttransfer  (+  Tcontroller).T_{access} = T_{seek} + T_{rot} + T_{transfer} \;(+\; T_{controller}).

  • Trev=60/rpmT_{rev} = 60 / \text{rpm} seconds per revolution.
  • Seek TseekT_{seek}: moving the arm to the cylinder; usually given (an average, or a track-to-track time). For uniformly random requests the average distance is about one third of the number of tracks.
  • Rotational latency: waiting for the sector to arrive under the head: between 00 and TrevT_{rev}, on average half a revolution, Trot=12TrevT_{rot} = \tfrac{1}{2} T_{rev}.
  • Transfer: the wanted bytes pass under the head: Ttransfer=bytesS⋅B⋅Trev=bytesdata rateT_{transfer} = \dfrac{\text{bytes}}{S \cdot B} \cdot T_{rev} = \dfrac{\text{bytes}}{\text{data rate}}, with data rate =SB/Trev= S B / T_{rev}. One sector takes Trev/ST_{rev} / S.
  • Controller overhead, when the question gives it (for example "ten times the disk transfer time"), is added.

Reading a file. Scattered sectors pay seek + rotation + transfer every time: n (Tseek+Trot+Tsector)n\,(T_{seek} + T_{rot} + T_{sector}). A contiguous file pays one seek and one rotational wait, and then streams: Tseek+Trot+n TsectorT_{seek} + T_{rot} + n\,T_{sector} (plus a track switch each time it crosses to the next track).

GATE model and real hardware. GATE model: a constant SS on every track, sector numbers from 00, the formulas above. Real hardware: outer tracks are longer and hold more sectors (zoned bit recording), so SS depends on the track and the sector number is no longer a simple formula; the legacy CHS address counts sectors from 11 (so n=(cH+h)S+(s−1)n = (cH + h)S + (s - 1)); modern drives hide the geometry behind logical block addresses and remap bad sectors. Flash storage (SSD) has no arm and no rotation, so none of the timing formulas apply to it.

How it works

The tables below are filled one row at a time. Every number is computed by a script from exact arithmetic, not typed.

Capacity and the size of an address. Four disks; the tracks, sectors and capacity follow from the product, and the two ways of naming a sector need different numbers of bits (Disk Y: 19 bits as one number, 20 as three fields).

Capacity and the number of bits of a sector address: start

Computed by a script, not typed
disktrackssectorscapacitybits for a sector numberbits for (cylinder, surface, sector)
Disk X: 2000 cylinders, 8 surfaces, 400 sectors per track, 512 bytes per sector
Disk Y: 1000 cylinders, 10 surfaces, 50 sectors per track, 512 bytes per sector
Disk Z: 8192 cylinders, 12 surfaces, 128 sectors per track, 4096 bytes per sector
Disk W: 64 cylinders, 4 surfaces, 32 sectors per track, 1024 bytes per sector

Step 0

Capacity = cylinders × surfaces × sectors per track × bytes per sector. The number of tracks on ONE surface equals the number of cylinders. Both address sizes are rounded up to whole bits.

0 / 4
computed by script: exact arithmetic (fractions) on disk geometry, rotation and seek. python3 scripts/gen-coa-disk-traces.py

From ⟨cylinder, surface, sector⟩ to a sector number. One cylinder of Disk Y holds 10×50=50010 \times 50 = 500 sectors, so each step in the cylinder field adds 500, each step in the surface field adds 50 and each step in the sector field adds 1.

From (cylinder, surface, sector) to a sector number on Disk Y: start

Computed by a script, not typed
address ⟨c, h, s⟩formulasector number
⟨0, 0, 0⟩
⟨0, 0, 49⟩
⟨0, 1, 0⟩
⟨0, 9, 49⟩
⟨1, 0, 0⟩
⟨37, 6, 12⟩
⟨999, 9, 49⟩

Step 0

Disk Y has 1000 cylinders, 10 surfaces and 50 sectors per track; every number starts at 0 (so the last sector is ⟨999, 9, 49⟩ = 499999).

0 / 7
computed by script: exact arithmetic (fractions) on disk geometry, rotation and seek. python3 scripts/gen-coa-disk-traces.py

And back. Two integer divisions: by the sectors per cylinder (the quotient is the cylinder), then the rest by the sectors per track (the quotient is the surface, the rest the sector).

From a sector number back to (cylinder, surface, sector) on Disk Y: start

Computed by a script, not typed
sector numbercylinder: divide by sectors per cylinder (500)surface and sector: divide the rest by 50address
0
49
50
499
500
123456
499999

Step 0

Integer division with remainder, twice; the reverse of the previous table.

0 / 7
computed by script: exact arithmetic (fractions) on disk geometry, rotation and seek. python3 scripts/gen-coa-disk-traces.py

Rotation and access time. The faster the spindle, the shorter the revolution and the wait; the transfer of one sector is tiny next to the seek and the wait.

Rotation and access time at four spindle speeds (400 sectors of 512 bytes per track, average seek 8 ms): start

Computed by a script, not typed
spindle speedone revolutionaverage rotational latencyone sectordata rate under the headaccess time of one random sector
5400 rpm
7200 rpm
10000 rpm
15000 rpm

Step 0

Average latency is HALF a revolution. Data rate = bytes on a track per revolution. Millisecond values are rounded for printing; the arithmetic is exact.

0 / 4
computed by script: exact arithmetic (fractions) on disk geometry, rotation and seek. python3 scripts/gen-coa-disk-traces.py

Reading a file. The same 800-sector file, scattered or contiguous. Paying the seek and the wait once instead of 800 times makes the contiguous read over 300 times faster; and a layout that ignores the rotation when it changes tracks loses a whole revolution each time.

Reading a file of 800 sectors from Disk X (7200 rpm, 400 sectors per track, average seek 8 ms): start

Computed by a script, not typed
layouttimehow
800 sectors, each at a random place
800 sectors contiguous, perfect skew, free track switch
800 sectors contiguous, perfect skew, 1 ms per track switch
800 sectors contiguous, NO skew, 1 ms per track switch
100 sectors contiguous inside one track

Step 0

Contiguous layout is dramatically faster than scattered sectors: the seek and the rotational wait are paid once, not 800 times. Skew means each track's sector 0 is placed a little later than the previous track's.

0 / 5
computed by script: exact arithmetic (fractions) on disk geometry, rotation and seek. python3 scripts/gen-coa-disk-traces.py

Worked examples

EX 1Capacity, address bits, and a missing parameter

Easy

Two disks, and the number of cylinders of a third disk of known capacity.

#include <stdio.h>
 
static int bits(long n) {
    int b = 0;
    while ((1L << b) < n) b++;
    return b;
}
 
int main(void) {
    long geo[2][4] = {{2000, 8, 400, 512}, {1000, 10, 50, 512}};   /* cylinders, surfaces, sectors per track, bytes per sector */
    for (int i = 0; i < 2; i++) {
        long c = geo[i][0], h = geo[i][1], s = geo[i][2], b = geo[i][3];
        long sectors = c * h * s;
        printf("disk %d: %ld tracks, %ld sectors, capacity %ld bytes (%.3f MiB)\n", i + 1, c * h, sectors, sectors * b, sectors * b / 1048576.0);
        printf("        sector number: %d bits; fields: %d + %d + %d = %d bits\n", bits(sectors), bits(c), bits(h), bits(s), bits(c) + bits(h) + bits(s));
    }
    /* a disk of 64 GiB with 16 surfaces, 2048 sectors per track of 512 bytes: how many cylinders? */
    long capacity = 64L << 30, h = 16, s = 2048, b = 512;
    printf("64 GiB disk: cylinders = %ld\n", capacity / (h * s * b));
    return 0;
}
disk 1: 16000 tracks, 6400000 sectors, capacity 3276800000 bytes (3125.000 MiB)
        sector number: 23 bits; fields: 11 + 3 + 9 = 23 bits
disk 2: 10000 tracks, 500000 sectors, capacity 256000000 bytes (244.141 MiB)
        sector number: 19 bits; fields: 10 + 4 + 6 = 20 bits
64 GiB disk: cylinders = 4096

Reading it. Disk 1: 2000⋅8=160002000 \cdot 8 = 16000 tracks, 16000⋅400=6.416000 \cdot 400 = 6.4 million sectors, ×512\times 512 bytes =3 276 800 000= 3\,276\,800\,000 bytes. A single sector number needs ⌈log⁡26 400 000⌉=23\lceil \log_2 6\,400\,000 \rceil = 23 bits. Disk 2 has 500 000500\,000 sectors: ⌈log⁡2500 000⌉=19\lceil \log_2 500\,000 \rceil = 19 bits as one number, but 10+4+6=2010 + 4 + 6 = 20 bits as three fields, because none of 10001000, 1010, 5050 is a power of two. For the third disk, capacity=C⋅H⋅S⋅B\text{capacity} = C \cdot H \cdot S \cdot B gives C=236/(24⋅211⋅29)=212=4096C = 2^{36} / (2^4 \cdot 2^{11} \cdot 2^9) = 2^{12} = 4096.

EX 2Sector number, address, and the last sector of a file

Medium

On Disk Y (1000 cylinders, 10 surfaces, 50 sectors per track): convert in both directions, check the formula for every sector, and find where a contiguous file of 20000 KB ends if it starts at ⟨120, 7, 30⟩.

#include <stdio.h>
 
#define CYL 1000L
#define SURF 10L
#define SECT 50L
 
static long to_number(long c, long h, long s) { return (c * SURF + h) * SECT + s; }
 
int main(void) {
    printf("<37,6,12> is sector %ld\n", to_number(37, 6, 12));
    long n = 123456;
    printf("sector %ld is <%ld,%ld,%ld>\n", n, n / (SURF * SECT), (n / SECT) % SURF, n % SECT);
 
    /* every address in cylinder-major order must get the next number, and the inverse must give the address back */
    long expect = 0, bad = 0;
    for (long c = 0; c < CYL; c++)
        for (long h = 0; h < SURF; h++)
            for (long s = 0; s < SECT; s++) {
                long m = to_number(c, h, s);
                if (m != expect) bad++;
                if (m / (SURF * SECT) != c || (m / SECT) % SURF != h || m % SECT != s) bad++;
                expect++;
            }
    printf("checked %ld sectors, %ld mismatches\n", expect, bad);
 
    /* a file of 20000 KB (sectors of 512 bytes) stored contiguously from <120,7,30> */
    long sectors = 20000L * 1024 / 512;
    long first = to_number(120, 7, 30), last = first + sectors - 1;
    printf("file: %ld sectors, from number %ld to %ld, last sector <%ld,%ld,%ld>\n", sectors, first, last, last / (SURF * SECT), (last / SECT) % SURF, last % SECT);
    return 0;
}
<37,6,12> is sector 18812
sector 123456 is <246,9,6>
checked 500000 sectors, 0 mismatches
file: 40000 sectors, from number 60380 to 100379, last sector <200,7,29>

Reading it. n=(37⋅10+6)⋅50+12=18812n = (37 \cdot 10 + 6) \cdot 50 + 12 = 18812. For 123456123456: 123456/500=246123456 / 500 = 246 rest 456456, then 456/50=9456 / 50 = 9 rest 66, so ⟨246,9,6⟩\langle 246, 9, 6 \rangle. The loop confirms the formula for all 500 000500\,000 sectors. The file has 20000⋅1024/512=4000020000 \cdot 1024 / 512 = 40000 sectors; the first is number (120⋅10+7)⋅50+30=60380(120 \cdot 10 + 7) \cdot 50 + 30 = 60380 and the last is 60380+40000−1=10037960380 + 40000 - 1 = 100379, which is 100379/500=200100379 / 500 = 200 rest 379379, then 379/50=7379 / 50 = 7 rest 2929: ⟨200,7,29⟩\langle 200, 7, 29 \rangle. The question usually asks only for the cylinder, 200: the file covers 200−120=80200 - 120 = 80 cylinders and a bit.

EX 3Time to read one sector, and a whole file

Medium

A 10000 rpm disk with an average seek time of 6 ms and 200 sectors of 512 bytes per track. How long does one random sector take, and how long does a file of 300 sectors take if it is scattered, or stored contiguously?

#include <stdio.h>
 
int main(void) {
    double rpm = 10000, seek = 6.0, spt = 200;           /* ms */
    double rev = 60000.0 / rpm, latency = rev / 2, sector = rev / spt;
    printf("revolution %.3f ms, average latency %.3f ms, one sector %.3f ms\n", rev, latency, sector);
    printf("one random sector: %.3f ms\n", seek + latency + sector);
    double n = 300;
    printf("300 sectors scattered: %.3f ms\n", n * (seek + latency + sector));
    printf("300 sectors contiguous, free track switches: %.3f ms\n", seek + latency + n * sector);
    printf("ratio %.1f\n", n * (seek + latency + sector) / (seek + latency + n * sector));
    return 0;
}
revolution 6.000 ms, average latency 3.000 ms, one sector 0.030 ms
one random sector: 9.030 ms
300 sectors scattered: 2709.000 ms
300 sectors contiguous, free track switches: 18.000 ms
ratio 150.5

Reading it. One revolution takes 60000/10000=660000/10000 = 6 ms; the average wait is 3 ms and one sector passes in 6/200=0.036/200 = 0.03 ms, so a random sector costs 6+3+0.03=9.036 + 3 + 0.03 = 9.03 ms: the transfer is a third of a percent of it. Scattered, 300 sectors cost 300×9.03=2709300 \times 9.03 = 2709 ms. Contiguous, the seek and the wait are paid once: 6+3+300×0.03=186 + 3 + 300 \times 0.03 = 18 ms (the file crosses one track boundary; with free track switches the time is the same).

EX 4A transfer rate, a seek that is a multiple of the latency, and the controller

GATE level

A disk turns at 10000 rpm and transfers at 40×10640 \times 10^6 bytes per second. The average seek time is three times the average rotational delay, and the controller needs five times the disk's transfer time. Find the average time to read a 512-byte sector.

#include <stdio.h>
 
int main(void) {
    double rev = 60.0 / 10000;                 /* seconds */
    double latency = rev / 2;
    double seek = 3 * latency;
    double transfer = 512 / 40e6;
    double controller = 5 * transfer;
    printf("latency %.4f ms, seek %.4f ms, disk transfer %.6f ms, controller %.6f ms\n", latency * 1e3, seek * 1e3, transfer * 1e3, controller * 1e3);
    printf("average time %.4f ms\n", (seek + latency + transfer + controller) * 1e3);
    return 0;
}
latency 3.0000 ms, seek 9.0000 ms, disk transfer 0.012800 ms, controller 0.064000 ms
average time 12.0768 ms

Reading it. The data rate is given directly, so the transfer is 512/(40×106)=12.8 μs512 / (40 \times 10^6) = 12.8\ \mu s (no need for the sectors per track). The average latency is half of 66 ms =3= 3 ms, the seek 3×3=93 \times 3 = 9 ms, the controller 5×12.8=64 μs5 \times 12.8 = 64\ \mu s. Total 9+3+0.0128+0.064=12.07689 + 3 + 0.0128 + 0.064 = 12.0768 ms. A "rounded to one decimal place" answer is 12.1 ms. Always check which quantities are given (seek, rate) and which must be derived from the rpm.

EX 5Which statement is true?

GATE level

The average rotational latency is half a revolution. True, if the wanted sector is equally likely to be anywhere on the track. Doubling the number of platters doubles the capacity and the data rate of a track read. The capacity doubles; the data rate of one track does not change (only one head reads at a time). Doubling the rpm halves the rotational latency and the transfer time but leaves the seek unchanged. True. Reading 100 consecutive sectors of a track costs about the same as reading 100 random sectors. False: the random case pays 100 seeks and 100 waits. Capacity does not depend on the rpm. True; the rpm only sets the time.

Cheat box

Cheat box

  • Capacity =C⋅H⋅S⋅B= C \cdot H \cdot S \cdot B. Tracks =C⋅H= C \cdot H. Cylinders == tracks per surface.
  • Sector number n=(cH+h)S+sn = (cH + h)S + s; back: c=⌊n/HS⌋c = \lfloor n/HS \rfloor, h=⌊n/S⌋ mod Hh = \lfloor n/S \rfloor \bmod H, s=n mod Ss = n \bmod S (all from 0).
  • Bits: one number ⌈log⁡2(CHS)⌉\lceil \log_2 (CHS) \rceil; three fields ⌈log⁡2C⌉+⌈log⁡2H⌉+⌈log⁡2S⌉\lceil \log_2 C \rceil + \lceil \log_2 H \rceil + \lceil \log_2 S \rceil.
  • Trev=60/rpmT_{rev} = 60 / \text{rpm}. Trot=12TrevT_{rot} = \frac{1}{2} T_{rev} (average). Sector time =Trev/S= T_{rev}/S. Data rate =SB/Trev= SB / T_{rev}.
  • Taccess=Tseek+Trot+Ttransfer (+ Tctrl)T_{access} = T_{seek} + T_{rot} + T_{transfer}\,(+\,T_{ctrl}). Scattered: n(⋅)n(\cdot). Contiguous: seek and wait once, then nn sector times.
  • Sizes are powers of two (1 KB=2101\,\text{KB} = 2^{10}); a quoted transfer rate in 10610^6 is decimal.

Traps and GATE patterns

Connections

The disk is the slowest level of the memory hierarchy; its cost per access is what caches and buffer pools exist to hide. The operating system chooses the order of requests to cut the seek part in disk scheduling, lays files out contiguously or in blocks in file allocation, and the data then moves by DMA. A database computes how many blocks a file or an index occupies from the block size and the record size in file organisation, because every block touched is one disk access of the kind computed here.

PYQs

15 previous year questions from your book. I re-solved each one myself (15 by running or simulating, 0 by reasoning only); the book's key is shown next to my answer. All PYQs

GATE 2015 · Set 1 · MCQ · 2 marksQ10 · page 523 of the book
Consider a typical disk that rotates at 15000
rotations per minute (RPM) and has a transfer rate
of 50 × 106 bytes /sec. If the average seek time of
the disk is twice the average rotational delay and
the controller's transfer time is 10 times the disk
transfer time, the average time (in milliseconds) to
read or write a 512-byte sector of the disk is .
GATE 2015 · Set 1 · MCQ · 2 marksQ11 · page 523 of the book
Consider a disk pack with a seek time of 4
milliseconds and rotational speed of 10000 rotations
per minute (RPM). It has 600 sectors per track and
each sector can store 512 bytes of data. Consider a file
stored in the disk. The file contains 2000 sectors
Assume that every sector access necessitates a seek,
And the average rotational latency for accessing each
sector is half of the time for one complete rotation.
The total time (in milliseconds) needed to read the
entire file is
GATE 2013 · MCQ · 2 marksQ12 · page 523 of the book
Consider a hard disk with 16 recording surfaces (0-
15) having 16384 cylinders (0-16383) and each
Computer Organization and Architecture

cylinder contains 64 sectors (0-63). Data storage
capacity in each sector is 512 bytes. Data are
organized cylinder-wise and 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
GATE 2011 · MCQ · 2 marksQ13 · page 524 of the book
An application loads 100 libraries at start-up.
Loading each library requires exactly one disk
access. The seek time of the disk to a random
location is given as 10 ms . Rotational speed of disk
is 6000 rpm . If all 100 libraries are loaded from
random locations on the disk, how long does it take
to load all libraries? (The time to transfer data from
the disk block once the head has been positioned at
the start of the block may be neglected.)
  • (a)0.50 s
  • (b)1.50 s
  • (c)1.25 s
  • (d)1.00 s
GATE 2005 · MCQQ17 · page 525 of the book
Consider the disk drive with the following
specifications: 16 surfaces, 512 tracks/surface, 512
sectors/track, 1 KB/sector, rotation speed 3000
rpm. The disk is operated in cycle stealing mode
whereby whenever one byte is ready it is sent to
memory, similarly, for writing, the disk interface
reads a 4-byte word from the memory in each
DMA cycle. Memory cycle time is 40 nsec The
maximum percentage of time that the CPU gets
blocked during DMA operation is
  • (a)10
  • (b)25
  • (c)40
  • (d)50
GATE 2026 · NATQ1 · page 357 of the book
Consider a hard disk with a rotational speed of
15000 rpm. The time to move the read/write head
from a track to its adjacent track is 1 millisecond.
Initially, the head is on track 0. The number of
sectors per track is 400, and the sector size is 1024
bytes.

It is necessary to transfer data from 10 randomly
located sectors in each of the following tracks in the
order: 5, 12, and 7.

The total time for the data transfer (in milliseconds)
from
the
hard
disk
is
______.
(rounded off to one decimal place)
GATE 2024 · NATQ5 · page 358 of the book
Consider a disk with the following specifications:
rotation speed of 6000 RPM, average seek time of
5 milliseconds, 500 sectors/track, 512-byte sectors.
A file has content stored in 3000 sectors located
randomly on the disk. Assuming average rotational
latency, the total time (in seconds, rounded off to 2
decimal places) to read the entire file from the disk is
______
GATE 2024 · NATQ6 · page 358 of the book
Consider a 512 GB hard disk with 32 storage
surfaces. There are 4096 sectors per track and each
sector holds 1024 bytes of data. The number of
cylinders in the hard disk is ______
GATE 2015 · Set 2 · NAT · 2 marksQ16 · page 359 of the book
Consider a typical disk that rotates at 15000 rotations
per minute (RPM) and has a transfer rate of 50 ×
106bytes/sec. If the average seek time of the disk is
twice the average rotational delay and the controller's
transfer time is 10 times the disk transfer time, the
average time (in milliseconds) to read or write a 512-
byte sector of the disk is ______
GATE 2015 · Set 1 · NATQ17 · page 359 of the book
Consider a disk pack with a seek time of 4
milliseconds and rotational speed of 10000 rotations
per minute (RPM). It has 600 sectors per track and
each sector can store 512 bytes of data. Consider a file
stored in the disk. The file contains 2000 sectors.
Assume that every sector access necessitates a seek,
and the average rotational latency for accessing each
sector is half of the time for one complete rotation.
The total time (in milliseconds) needed to read the
entire file is ______
GATE 2013 · MCQ · 2 marksQ20 · page 360 of the book
Consider a hard disk with 16 recording surfaces (0–
15) having 16384 cylinders (0–16383) and each
cylinder contains 64 sectors (0–63). Each sector
stores 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
starting at disk location (1200, 9, 40). What is the
cylinder number of the last sector of the file, if it is
stored contiguously?
year not read yetQ22 · page 360 of the book
An application loads 100 libraries at startup. Loading
each library requires exactly one disk access. The
seek time of the disk to a random location is given as
10 ms. Rotational speed of disk is 6000 rpm. If all 100
libraries are loaded from random locations on the
disk, how long does it take to load all libraries? (The
time to transfer data from the disk block once the head
has been positioned at the start of the block may be
neglected.)
  • (a)0.50s
  • (b)1.50s
  • (c)1.25s
  • (d)1.00 s
GATE 2009 · MCQ · 2 marksQ24 · page 360 of the book
A hard disk has 63 sectors per track, 10 platters each
with 2 recording surfaces and 1000 cylinders. The
address of a sector is given as a triple (c,h,s), where c
is the cylinder number, h is the surface number and s
is the sector number. Thus, the 0th sector is addressed
as ⟨0,0,0⟩, the 1st sector as ⟨0,0,1⟩, and so on.

The address ⟨400,16,29⟩ corresponds to sector
number:
  • (a)505035
  • (b)505036
  • (c)505037
  • (d)505038 OPERATING SYSTEMS
GATE 2009 · MCQ · 2 marksQ25 · page 361 of the book
A hard disk has 63 sectors per track, 10 platters
each with 2 recording surfaces and 1000 cylinders.
The address of a sector is given as a triple (c,h,s),
where c is the cylinder number, h is the surface
number and s is the sector number. Thus, the 0th
sector is addressed as ⟨0,0,0⟩, the 1st sector as
⟨0,0,1⟩, and so on.

The address of 1039th sector is
  • (a)⟨0,15,31⟩
  • (b)⟨0,16,30⟩
  • (c)⟨0,16,31⟩
  • (d)⟨0,17,31⟩
GATE 2007 · MCQ · 1 markQ28 · page 361 of the book
Consider a disk pack with 16 surfaces, 128 tracks per
surface and 256 sectors per track. 512 bytes of data
are stored in a bit serial manner in a sector. The
capacity of the disk pack and the number of bits
required to specify a particular sector in the disk pack
are respectively:
  • (a)256 Mbyte, 19 bits
  • (b)256 Mbyte, 28 bits
  • (c)512 Mbyte, 20 bits
  • (d)64 Gbyte, 28 bits

Self-check

Question 1

A disk has 16 surfaces, 1024 cylinders, 64 sectors per track and 1 KB sectors. Its capacity, and the number of bits of a sector number?

Show answer

16⋅1024⋅64⋅1024=24⋅210⋅26⋅210=23016 \cdot 1024 \cdot 64 \cdot 1024 = 2^4 \cdot 2^{10} \cdot 2^6 \cdot 2^{10} = 2^{30} bytes, 1 GB. There are 24+10+6=2202^{4 + 10 + 6} = 2^{20} sectors, so 20 bits.

Question 2

On a disk with 8 surfaces and 100 sectors per track, which address ⟨c, h, s⟩ is sector number 5000?

Show answer

One cylinder holds 8⋅100=8008 \cdot 100 = 800 sectors: 5000/800=65000 / 800 = 6 rest 200200; 200/100=2200 / 100 = 2 rest 00. The address is ⟨6, 2, 0⟩.

Question 3

The average rotational latency of a 12000 rpm disk?

Show answer

A revolution takes 60/12000=560/12000 = 5 ms, so the average latency is 2.5 ms.

Question 4

A 10000 rpm disk has an average seek of 6 ms and 200 sectors per track. Average time of one random sector?

Show answer

Revolution 6 ms, latency 3 ms, sector time 6/200=0.036/200 = 0.03 ms: 6+3+0.03=9.036 + 3 + 0.03 = 9.03 ms.

Question 5

The same disk: a file of 300 sectors stored contiguously (free track switches)?

Show answer

One seek, one wait, then 300 sector times: 6+3+300⋅0.03=186 + 3 + 300 \cdot 0.03 = 18 ms.

Revision card

One-screen revision

  • Capacity =CHSB= C H S B; cylinders == tracks per surface; sizes in powers of two.
  • n=(cH+h)S+sn = (cH + h)S + s and back by two divisions; bits: one number or three fields.
  • Trev=60/rpmT_{rev} = 60/\text{rpm}; average latency =Trev/2= T_{rev}/2; sector =Trev/S= T_{rev}/S; Taccess=T_{access} = seek ++ latency ++ transfer.
  • Scattered file: nn full accesses. Contiguous: seek and wait once.
  • GATE model: constant SS, numbers from 0; real disks use zones and logical block addresses.

References

  • ·Hamacher, Vranesic, Zaky, Computer Organization, 5th ed., Chapter 5 Basic Processing / Memory (magnetic disks)
  • ·Silberschatz, Galvin, Gagne, Operating System Concepts, Chapter 11 Mass-Storage Structure (disk structure, disk performance)
  • ·Patterson and Hennessy, Computer Organization and Design, Storage chapter (disk performance)

Verification

Every number in the four tables is produced by scripts/gen-coa-disk-traces.py from scripts/coa_disk.py (exact fractions) and recomputed in TypeScript by tests/coa-disk-traces.test.ts; the three C programs are compiled and run by npm run verify:c (their output is written by scripts/fill-c-output.py, not typed). scripts/enum-checks/coa_disk.py checks the address formulas against an enumeration of every address of seven small disks, the bit counts against bit_length, the average rotational latency by averaging over arrival phases, a contiguous read by a timeline simulation (with and without skew) and the cylinder of the last sector of a file by an odometer on 300 random files; it also confirms that the mean seek distance of random requests is about one third of the tracks. GATE model versus real hardware: the page uses a constant number of sectors per track and sector numbers starting at 0, as GATE questions do; real disks use zoned recording and the sector field of the legacy CHS address starts at 1. Seek-time figures are averages given in the question, not derived. Textbook chapter titles are from memory. SECOND PASS (2026-11-02, done by the assistant, not a human check): every Self-check question was solved before the printed answer was read and all agreed; the definitions, worked examples, cheat box and traps were read claim by claim and the numbers re-derived by hand (long C programs were not re-read line by line: they are compiled and compared by npm run verify:c, and their printed outputs were checked against the prose). No defect found. Status raised to self-checked; verified needs a textbook or human check.

last verified: never

My notes (saved in this browser)