Course list: http://www.c-jump.com/bcc/
On disk, data stored in sectors
Sector typically holds 512 bytes of data
Sector is the smallest unit that can be read or written
Memory is holding bytes of data
Each byte in memory can be accessed independently
Note: Sector ize is usually 512 bytes long:
Putting it all together:
Number of cylinders (tracks), heads (sides), and sectors (aka CHS) uniquely identify the physical geometry of the storage units on a disk
CHS also yields disk capacity:
Capacity = Cylinders × Heads × Sectors × sector_size
Did that drive really have 15 heads?
Could 8 platters really fit in that less than 1 inch space?
CHS = 13,328/15/63 is the reported geometry.
That is, this is what it says on the drive!
Let's see what the real geometry is...
Designed for early IDE/ATA HDDs
C <= 1,024
H <= 16
S <= 63
This mode works for drives up to 504 MB in capacity
ECHS is used for drives between 504 MB and 8 GB
CHS addressing is limited to
10 bits for cylinder (<=1024)
8 bits for head (<=256), and
6 bits for sector (<=63 since first sector is 1.)
In ECHS, the actual C value is divided by 2 and the H value multiplied by 2 until:
C < 1024 or H >= 255
Reported CHS geometry = 18,383/16/63
Capacity = 9,487,392,768 B (9 GB)
In fact, this drive might very well have two platters (i.e., 4 heads)
True geometry is CHS = 73,532/4/63
The translation is handled by the disk drive controller
On small (<=8GB) drives, every track has the same number of sectors
The outside tracks are less densely packed with bits than inside tracks
ZBR allows a variable number of sectors/track
Enabled due to sophisticated electronics built into HDD controller
Allowed manufacturers to optimize the disk surface and build higher-capacity drives
CHS values no longer represent actual geometry
LBA is an absolute sector addressing scheme used by ZBR
First sector is 0
The hard drive controller translates LBA (physical geometry) into CHS addressing (logical geometry) used by the operating system and BIOS
A sector is the most basic physical I/O unit on a disk
Files are linked lists on the disk; reading/writing one sector at a time would be very slow
Clusters are logical groupings of sectors by an operating system to optimize I/O
Typical hard drive cluster sizes range from 4 to 64 sectors (2-32 KB)
But they result in empty space slack at the end of a file...
...and a data hiding opportunity.
|
|
|