Hard Disk Drive Geometry

  

Hard Disk Drive Geometry

πŸ”· What is Disk Geometry?

Disk geometry refers to the physical structure and layout of a hard disk, including how data is organized and accessed.


1. Basic Components of HDD

πŸ”· 1. Platter

  • circular disk surface where data is stored

  • Made of rigid material (e.g., aluminum)

  • Coated with magnetic material to store bits

πŸ‘‰ A disk may have multiple platters


πŸ”· 2. Surface

  • Each platter has two sides (top and bottom)

  • Each side is called a surface

  • Data is stored on both surfaces


πŸ”· 3. Spindle

  • Central rod that holds platters together

  • Connected to a motor

  • Rotates the platters at constant speed

πŸ“Œ Speed measured in RPM (Rotations Per Minute)

  • Typical: 7200 – 15000 RPM


πŸ”· 4. Disk Head

  • Used to read/write data

  • One head per surface

  • Detects or changes magnetic patterns


πŸ”· 5. Disk Arm

  • Holds the disk head

  • Moves across the disk to access different locations






2. Data Organization on Disk

πŸ”· 1. Tracks

  • Concentric circular paths on disk surface

  • Each track stores data


πŸ”· 2. Sectors

  • Each track is divided into small units called sectors

  • Typical size: 512 bytes

πŸ‘‰ Disk is viewed as:

Array of sectors (0 to n-1)

πŸ”· 3. Cylinders

  • Tracks at the same radius across all platters

  • Form a cylinder

πŸ‘‰ Accessing a cylinder avoids extra head movement




3. Disk Access Time Components

Disk I/O time consists of three main parts:


πŸ”΄ 1. Seek Time

  • Time to move disk arm to correct track

  • Includes:

    • Acceleration

    • Movement

    • Deceleration

    • Settling

πŸ‘‰ Most expensive operation


πŸ”΅ 2. Rotational Latency

  • Time waiting for sector to rotate under head

  • Depends on disk speed

πŸ‘‰ Example:

  • 10,000 RPM → ~6 ms per rotation


🟒 3. Transfer Time

  • Time to actually read/write data

  • Happens once sector is under head


🎯 Total Disk Access Time

Access Time = Seek Time + Rotational Latency + Transfer Time

4. Disk Operation Example

To read a block:

  1. Move head to correct track (seek)

  2. Wait for correct sector (rotation delay - latency)

  3. Read/write data (transfer)


5. Important Optimization Details

πŸ”· 1. Track Skew

  • Sectors are slightly offset between tracks

πŸ‘‰ Why?

  • When moving to next track:

    • Disk rotates during head movement

    • Prevents missing next sector





πŸ”· 2. Zoned Bit Recording (Multi-Zone)

  • Outer tracks have:

    • More space

    • More sectors

πŸ‘‰ Disk divided into zones

  • Each zone has same sectors per track

  • Outer zones have more sectors


πŸ”· 3. Disk Cache (Track Buffer)

  • Small memory (8–16 MB) inside disk

  • Stores recently read/written data

πŸ“Œ Benefits:

  • Faster repeated access

  • Improves performance


πŸ”΄ Write Policies

TypeDescription
Write-through        Data written to disk before completion
Write-back        Data stored in cache first

πŸ‘‰ Write-back is faster but risky (power failure)


6. Key Insights

  • Disk performance depends heavily on:

    • Head movement

    • Rotation delay

  • Sequential access is:
    πŸ‘‰ Much faster than random access


7. Summary

  • HDD consists of:

    • Platters, surfaces, tracks, sectors

  • Access time = seek + rotation + transfer

  • Optimizations:

    • Track skew

    • Zoning

    • Disk cache


Problem 1: Basic Disk Access Time

Given:

  • Seek time = 8 ms

  • Rotational speed = 7200 RPM

  • Transfer size = 4 KB

  • Transfer rate = 100 MB/s


πŸ”· Find:

πŸ‘‰ Total disk access time


✏️ Solution:

Step 1: Convert RPM → Rotation time

Rotation time=607200=0.0083 sec=8.33 ms\text{Rotation time} = \frac{60}{7200} = 0.0083 \text{ sec} = 8.33 \text{ ms}

πŸ‘‰ Average rotational latency = half rotation:

=8.332=4.17 ms= \frac{8.33}{2} = 4.17 \text{ ms}

Step 2: Transfer Time

Transfer time=4 KB100 MB/s\text{Transfer time} = \frac{4 \text{ KB}}{100 \text{ MB/s}}

Convert:

  • 4 KB = 4096 bytes

  • 100 MB/s = 100×1024×1024

=40961048576000.000039 sec=0.039 ms= \frac{4096}{104857600} \approx 0.000039 \text{ sec} = 0.039 \text{ ms}

Step 3: Total Access Time

Total=Seek+Rotation+Transfer\text{Total} = \text{Seek} + \text{Rotation} + \text{Transfer}
=8+4.17+0.03912.21 ms







= 8 + 4.17 + 0.039 \approx \boxed{12.21 \text{ ms}}

Problem 2: Worst-Case vs Best-Case Access Time

πŸ”· Given:

  • Disk speed = 6000 RPM

  • Average seek time = 6 ms

  • Maximum seek time = 12 ms

  • Transfer time = 0.05 ms


πŸ”· Find:

  1. Best-case access time

  2. Worst-case access time


✏️ Solution:

Step 1: Rotation Time

Rotation time=606000=0.01 sec=10 ms\text{Rotation time} = \frac{60}{6000} = 0.01 \text{ sec} = 10 \text{ ms}

πŸ”Ή Best Case

  • Seek time = 0 ms (already on track)

  • Rotational latency = 0 ms (sector just arrived)

Best case=0+0+0.05=0.05 ms\text{Best case} = 0 + 0 + 0.05 = \boxed{0.05 \text{ ms}}

πŸ”Ή Worst Case

  • Seek time = 12 ms

  • Rotational latency = full rotation = 10 ms

Worst case=12+10+0.05=22.05 ms
\text{Worst case} = 12 + 10 + 0.05 = \boxed{22.05 \text{ ms}}

Problem 3: Sequential vs Random Access 

πŸ”· Given:

  • Disk speed = 7200 RPM

  • Average seek time = 9 ms

  • Transfer rate = 120 MB/s

  • Block size = 4 KB

  • Number of blocks = 100


πŸ”· Find:

πŸ‘‰ Total time for:

  1. Sequential read of 100 blocks

  2. Random read of 100 blocks


✏️ Solution:


πŸ”Ή Step 1: Rotation Time

Rotation time=607200=8.33 ms\text{Rotation time} = \frac{60}{7200} = 8.33 \text{ ms}

πŸ‘‰ Average rotational latency:

=4.17 ms= 4.17 \text{ ms}

πŸ”Ή Step 2: Transfer Time per Block

4 KB=4096 bytes4 \text{ KB} = 4096 \text{ bytes}
Transfer time=4096120×1024×10240.000032 sec=0.032 ms\text{Transfer time} = \frac{4096}{120 \times 1024 \times 1024} \approx 0.000032 \text{ sec} = 0.032 \text{ ms}

Case 1: Sequential Access

πŸ‘‰ Key idea:

  • Only one seek + one rotation

  • Then continuous transfer

Total Transfer:

100×0.032=3.2 ms100 \times 0.032 = 3.2 \text{ ms}

Total Time:

=9+4.17+3.2=16.37 ms= 9 + 4.17 + 3.2 = \boxed{16.37 \text{ ms}}

Case 2: Random Access

πŸ‘‰ Key idea:

  • Each block requires:

    • Seek + rotation + transfer

Time per block:

=9+4.17+0.032=13.202 ms= 9 + 4.17 + 0.032 = 13.202 \text{ ms}

Total:

100×13.202=1320.2 ms100 \times 13.202 = \boxed{1320.2 \text{ ms}}

Final Insight 

Access TypeTime
Sequential        16.37 ms
Random        1320.2 ms (~1.3 sec)

πŸ‘‰ Sequential access is orders of magnitude faster than random access

Comments

Popular posts from this blog

Operating Systems OS PCCST403 Semester 4 BTech KTU CS 2024 Scheme

Introduction to Operating System -Virtualization, Concurrency, and Persistence

Operating Systems PCCST403 Scheme and Syllabus