Hard Disk Structure In OS
A hard disk is a secondary storage that stores a large amount of data. The hard disk drive contains dozens of disks. These disks are also known as platters. These platters are mounted over the spindle, which rotates in any direction, i.e., clockwise or anti-clockwise. Let’s look at the hard disk structure in OS.
Physical Structure of a Hard Disk Drive (HDD)
The physical structure of a hard disk is made up of several critical components that work together to store and retrieve data. Understanding these components is essential for understanding how an operating system interacts with a hard disk.
1. Platter in Hard Disk
The manufacturer constructs the Platter from aluminum or iron oxide. The platter diameter range is 1.8 inches to 5.25 inches. Here is a 4-platter in hard disk descriptive diagram
Top Points on platters in HDD is given below
- Platters are circular disks used to store data in a Hard Disk Drive (HDD).
- Data is stored magnetically on the surface of each platter.
- Multiple platters are stacked on a single spindle inside the hard disk, where each platter holds the same number of tracks.
- Multiple platters increase the storage capacity. So, more platters = more storage capacity in the HDD.
- Tracks and sectors are used to organize data on each platter surface.
- Each platter has two sides (top and bottom) that can store data.
- Each surface has a dedicated read/write head that floats just above it. One surface of the Platter requires one Read/Write head, and a second R/W head is used for the other surface to store information.
- Platters spin at high speeds, typically 5400, 7200, or 10000 RPM.
- Made of aluminum, glass, or ceramic, coated with magnetic material.
- Precision is critical — even tiny dust particles can damage platters.
2. Surface of platter in Hard Disk
A surface in an HDD refers to one side of a platter where data is stored magnetically. Each platter may have a maximum of two surfaces, with each surface accessed by a separate read/write head.
Top Points on Surfaces in HDD is given below
- A surface is one side of a platter used to store data in a hard disk.
- Each platter has two surfaces, the top and the bottom.
- Both surfaces are magnetically coated and can store data.
- Each surface has its dedicated read/write head.
- All surfaces spin together on a common spindle.
- Data is organized into tracks and sectors on each surface.
- More surfaces = more data storage capacity.
- Not all surfaces are always used; some may be disabled for reliability or design reasons.
- For example, a hard disk with 3 platters has 6 surfaces (3×2).
- Storage is calculated using all active surfaces when determining total disk capacity.
Important: Scenarios Where Only One Surface Is Used
|
3. Spindle in a Hard Disk
The spindle in an HDD is the rotating axis that holds and spins all the platters together at high speed, enabling the read/write heads to access data efficiently.
Top Points on Spindle in HDD are given below:
- The spindle is the central axis around which all the platters are mounted.
- It is connected to a spindle motor that spins the platters at a constant speed.
- All platters rotate simultaneously on the same spindle.
- Typical spindle speeds are 5400 RPM, 7200 RPM, 10000 RPM, or more in high-performance drives.
- Higher spindle speed = faster data access, but also more heat and noise.
- The spindle must ensure vibration-free, stable rotation for accurate read/write operations.
- Often works with cooling mechanisms in enterprise drives to prevent overheating.
- Slower spindle = less power consumption, common in eco or laptop HDDs.
4. Tracks in a Hard Disk
Circular areas of the disk are known as tracks.
Top Points on tracks in HDD are given below
- A track is a concentric circular path on the surface of a platter.
- Each platter surface contains thousands of tracks.
- Tracks are numbered from the outer edge (0) to the center of the platter.
- Data is stored magnetically along the tracks.
- Tracks are divided into smaller units called sectors (typically 512 bytes or 4 KB).
- Tracks in the same position across platters form a cylinder.
- The read/write head moves radially to access different tracks.
- Modern drives use Zone Bit Recording (ZBR), where outer tracks store more sectors than inner ones.
- Track arrangement affects seek time (time to locate data).
- Track density (tracks per inch) determines how much data can be stored on a platter. There may be more than 1000 tracks on a 3.5-inch hard disk.
5. Sectors in Hard Disk
We further divide tracks into several small units, and these units are known as sectors.
Top Points on the sector in HDD are given below
- A sector is the smallest physical storage unit on a hard disk.
- Each track is divided into multiple sectors.
- A sector typically stores 512 bytes (older standard) or 4096 bytes (4 KB) in newer drives.
- Sector numbers within each track start from 1 and go sequentially (e.g., 1, 2, 3, …, n). All tracks on each platter surface have independent sector numbers.
- Data is read or written one sector at a time.
- Each sector includes user data + metadata (like error-correcting code).
- HDD uses Logical Block Addressing (LBA) to identify sectors.
- More sectors per track = higher data capacity.
- If a sector is damaged, it becomes a bad sector and is avoided by the system. Had disk may be damaged due to these bad sectors.
- Sectors work with tracks and platters to organize and manage data storage efficiently.
6. R/W Head in Hard Disk
R/W Heads move forth and back over the Platter surfaces to Read or Write the data on sectors. Read/Write heads do not touch the platter surface.
Top Points on R/W head in HDD are given below
- The Read/Write (R/W) head is the component that reads data from and writes data to the hard disk platters.
- Each platter surface has its own dedicated R/W head.
- The R/W head remains just nanometers above the platter surface while it spins (no physical contact). If the R/W head contacts the platter surface, it can damage the hard disk.
- Data is written by magnetizing tiny spots on the platter’s surface. Data is read by detecting the magnetic polarity of those spots.
- The R/W head is attached to an actuator arm, which moves back and forth across the disk surface, allowing access to different tracks.
- It can quickly switch between tracks, allowing fast access to data.
- Uses electromagnetic induction principles for reading/writing.
- If the R/W head crashes into the platter (called a head crash), it can damage the data surface
7. Cylinder in Hard Disk
All Corresponding tracks with the same radius of all platters in the Hard disk are known as cylinders. In simple words, we say
“Each track of all platters with the same radius is called a cylinder”.
So, the number of tracks on the Platter always equals the number of cylinders. For example, in a hard disk, where each Platter contains 600 tracks, the number of cylinders will also be 600 in the hard disk.
Cylinder Numbering starts with zero from the outermost cylinder.
Note: A cylinder is a virtual vertical column of tracks through all platters in the HDD.
8. Cluster in Hard Disk
Cluster is also known as blocks. A group of sectors makes a cluster. There may be 64 or more sectors in a cluster. OS uses these clusters to Read/Write the data.
Top Points on cluster in HDD are given below
- A cluster is the smallest unit of disk space allocation for storing a file in a file system (like FAT or NTFS).
- It is made up of one or more sectors (e.g., 1 cluster = 4 sectors = 2 KB, depending on settings).
- Even if a file is smaller than a cluster, it still uses a whole cluster, causing possible space wastage.
- Cluster size is set by the file system during formatting (e.g., 4 KB, 8 KB, etc.).
- Large cluster sizes = less overhead but more wasted space (slack space).
- Smaller cluster sizes = less waste but slightly slower access due to more metadata.
- A single file may span multiple clusters.
- Operating systems use a File Allocation Table (FAT) or similar structures to keep track of cluster chains.
- Efficient cluster management is crucial for disk performance and space optimization.
Logical Structure of a Hard Disk in an OS
While the physical structure is vital for understanding the hardware, the logical structure is how the operating system interacts with the hard disk.
1. Disk Partitioning
Operating systems divide the hard disk into logical units called partitions. Each partition acts like a separate disk, allowing the operating system to manage them individually. Partition tables (e.g., MBR or GPT) define the partitions and their properties.
2. File System Structure
The file system is responsible for organizing data on the hard disk. Popular file systems like NTFS, FAT32, and EXT4 use directories and files to organize the data stored on a disk.
-
Cluster: A group of sectors that the operating system treats as a single unit for reading and writing.
-
Directory Structure: The hierarchical organization that holds information about files, folders, and other directories.
3. Master Boot Record (MBR) and GUID Partition Table (GPT)
-
MBR (Master Boot Record): It contains information about disk partitions and booting instructions. MBR supports disks up to 2 TB.
-
GPT (GUID Partition Table): A more modern partitioning system that supports larger disks and more partitions. GPT is used in UEFI-based systems.
How an Operating System Interacts with the Hard Disk
The operating system (OS) manages the data stored on the hard disk by using device drivers, disk controllers, and file system management techniques.
1. Disk Controllers
Disk controllers manage the communication between the hard disk and the computer’s motherboard. They translate the OS’s read/write commands into actions that the disk hardware can understand.
2. File System Management
The OS uses the file system to track files stored on the disk, ensuring efficient retrieval and storage. It maps logical file locations to physical locations on the disk, handles file access control, and performs other essential functions like disk defragmentation.
3. Disk Scheduling
The operating system uses disk scheduling algorithms (e.g., FCFS, SSTF, SCAN) to determine the order in which disk access requests are processed, optimizing the overall I/O performance.
Hard Disk Capacity
As we know, there are several platters in the hard disk. Each Platter mostly contains two surfaces with their R/W heads. There are several cylinders/tracks in the hard disk. Each track is divided into multiple sectors. Each sector has some size, but most sectors are 512 Bytes.
Hard disk Capacity =
No. of platters × Surfaces per platter × Tracks per surface × Sectors per track × Bytes per sector
Top Points on Hard Disk Capacity are
- Hard disk capacity refers to the total amount of data the HDD can store, measured in bytes (GB, TB).
- Capacity depends mainly on the number of platters, tracks, sectors per track, and sector size.
- Common sector size = 512 bytes (older) or 4096 bytes (4 KB) (modern “Advanced Format” drives).
- More platters or higher density (tracks/sectors) = higher capacity.
- HDDs come in sizes from 500 GB to 20 TB or more, for personal and enterprise use.
- Usable space is slightly less than advertised due to file system overhead and manufacturer rounding (1 TB = 10¹² bytes vs 2³⁰ bytes). Some space is reserved for bad sector management, metadata, and formatting.
- Disk partitioning affects how capacity is divided and used by the operating system.
- SSD vs HDD: While SSDs are faster, HDDs still offer more capacity per dollar.
Hard Disk Structure Numerical Questions
Let’s explain various numerical questions of hard disk structure which involve the following parameters
- Hard disk size
- platter size
- bits required to represent the hard disk size
- and many other things
Hard Disk Question: 01
Suppose there are eight platters in the hard disk drive. Each Platter has two surfaces so that 16-surfaces will be in the hard drive. Therefore, the required R/W head will also be 16. Suppose there are 1,024 cylinders and 128 sectors in each track. The sector size is 512 bytes. Then
- Calculate Disk Size.
- How many bits are required to represent the disk size?
Part A – Solution
Size of Hard Disk = Cylinder x Heads X Sectors x Sector-Size
= 1,024 x 16 x 128 x 512 Bytes
= 210 + 24 + 27 + 29 Bytes = 230Bytes = 2GB
Part B – Solution
As 2GB = 2*230bits, To represent a 2GB hard disk, use 31 bits.
Hard Disk Question: 02
Find the size of a Single platter if the track size is 1KB and there are 1024 cylinders.
Solution
There is a single platter, so the R/W head’s requirement will be 2.
Size of Platter = Cylinder x Heads X track size (because Track size = Sectors x Sector_Size)
= 210 + 21 + 210 Bytes
=21+220 Bytes = 2MB
Hard Disk Question: 03
Why does the sector number addressing CHS (cylinder Head Sector) start at sector one and not 0?
Solution
For all translation modes, cylinder (C) =0, Head (H) =0, and Sector (S) =1, which is equivalent to Logical Block Address (LBA) =0. So, the value of the sector is always 1.
Disk Performance Parameters
Here are some key parameters used to assess the performance of a hard disk.
- Seek Time: refers to the amount of time required by the read/write head to move to the requested track.
- Latency or rotational delay: refers to the time required for the requested sector to come under the read/write head.
- Data transfer rate is defined as the amount of data transferred per unit time, for example, 30 MB/sec.
- Data transfer time is the duration required to move a specific amount of data from one device to another. it depends on the data transfer rate of the disk.
- The average access time is calculated by following the formula
Average Access Time = Seek Time + Rotational Latency + Data Transfer Time