0% found this document useful (0 votes)
103 views

Hard Disk Drive

Hard disk drives store data on platters that spin. Data is arranged in concentric tracks on each platter surface. Tracks are divided into sectors, the smallest storage unit, typically 512 bytes. Files larger than 512 bytes are stored using clusters that allocate multiple sectors contiguously when possible to avoid fragmentation. The master boot record located in the first sector controls startup.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views

Hard Disk Drive

Hard disk drives store data on platters that spin. Data is arranged in concentric tracks on each platter surface. Tracks are divided into sectors, the smallest storage unit, typically 512 bytes. Files larger than 512 bytes are stored using clusters that allocate multiple sectors contiguously when possible to avoid fragmentation. The master boot record located in the first sector controls startup.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Hard Disk Drive Basics

Making Tracks

Sectors and Clusters

A hard disk is a sealed unit containing a number of platters in a stack. Hard disks may be mounted in a
horizontal or a vertical position. In this description, the hard drive is mounted horizontally.
Electromagnetic read/write heads are positioned above and below each platter. As the platters spin, the drive
heads move in toward the center surface and out toward the edge. In this way, the drive heads can reach the
entire surface of each platter.

Making Tracks
On a hard disk, data is stored in thin, concentric bands. A drive head, while in one position can read or write
a circular ring, or band called a track. There can be more than a thousand tracks on a 3.5-inch hard disk.
Sections within each track are called sectors. A sector is the smallest physical storage unit on a disk, and is
almost always 512 bytes (0.5 kB) in size.
The figure below shows a hard disk with two platters.
Parts of a Hard Drive

The structure of older hard drives (i.e. prior to Windows 95) will refer to a cylinder/ head/ sector notation. A
cylinder is formed while all drive heads are in the same position on the disk.
The tracks, stacked on top of each other form a cylinder. This scheme is slowly being eliminated with
modern hard drives. All new disks use a translation factor to make their actual hardware layout appear
continuous, as this is the way that operating systems from Windows 95 onward like to work.
To the operating system of a computer, tracks are logical rather than physical in structure, and are established
when the disk is low-level formatted. Tracks are numbered, starting at 0 (the outermost edge of the disk), and

going up to the highest numbered track, typically 1023, (close to the center). Similarly, there are 1,024
cylinders (numbered from 0 to 1023) on a hard disk.
The stack of platters rotate at a constant speed. The drive head, while positioned close to the center of the
disk reads from a surface that is passing by more slowly than the surface at the outer edges of the disk.
To compensate for this physical difference, tracks near the outside of the disk are less-densely populated
with data than the tracks near the center of the disk. The result of the different data density is that the same
amount of data can be read over the same period of time, from any drive head position.
The disk space is filled with data according to a standard plan. One side of one platter contains space
reserved for hardware track-positioning information and is not available to the operating system. Thus, a disk
assembly containing two platters has three sides available for data. Track-positioning data is written to the
disk during assembly at the factory. The system disk controller reads this data to place the drive heads in the
correct sector position.
Up

Sectors and Clusters


A sector, being the smallest physical storage unit on the disk, is almost always 512 bytes in size because 512
is a power of 2 (2 to the power of 9). The number 2 is used because there are two states in the most basic of
computer languages on and off.
Each disk sector is labelled using the factory track-positioning data. Sector identification data is written to
the area immediately before the contents of the sector and identifies the starting address of the sector.
The optimal method of storing a file on a disk is in a contiguous series, i.e. all data in a stream stored end-toend in a single line. As many files are larger than 512 bytes, it is up to the file system to allocate sectors to
store the file's data. For example, if the file size is 800 bytes, two 512 k sectors are allocated for the file.
A cluster can consist of one or more consecutive sectors. The number of sectors is always an exponent of 2.
A cluster could consist of 1 sector (2^0), or, more frequently, 8 sectors (2^3). The only odd number a of
sectors a cluster could consist of is 1. It could not be 5 sectors or an even number that is not an exponent of
2. It would not be 10 sectors, but could be 8 or 16 sectors.
They are called clusters because the space is reserved for the data contents. This process protects the stored
data from being over-written. Later, if data is appended to the file and its size grows to 1600 bytes, another
two clusters are allocated, storing the entire file within four clusters.
Sectors and Clusters

If contiguous clusters are not available (clusters that are adjacent to each other on the disk), the second two
clusters may be written elsewhere on the same disk or within the same cylinder or on a different cylinder
wherever the file system finds two sectors available.
A file stored in this non-contiguous manner is considered to be fragmented. Fragmentation can slow down
system performance if the file system must direct the drive heads to several different addresses to find all the
data in the file you want to read. The extra time for the heads to travel to a number of addresses causes a
delay before the entire file is retrieved.
Cluster size can be changed to optimize file storage. A larger cluster size reduces the potential for
fragmentation, but increases the likelihood that clusters will have unused space. Using clusters larger than
one sector reduces fragmentation, and reduces the amount of disk space needed to store the information
about the used and unused areas on the disk.
Most disks used in personal computers today rotate at a constant angular velocity. The tracks near the outside
of the disk are less densely populated with data than the tracks near the center of the disk. Thus, a fixed
amount of data can be read in a constant period of time, even though the speed of the disk surface is faster on
the tracks located further away from the center of the disk.
Modern disks reserve one side of one platter for track positioning information, which is written to the disk at
the factory during disk assembly.
It is not available to the operating system. The disk controller uses this information to fine tune the head
locations when the heads move to another location on the disk. When a side contains the track position
information, that side cannot be used for data. Thus, a disk assembly containing two platters has three sides
that are available for data.
Master Boot Record (MBR)
The Master Boot Record, created when you create the first partition on the hard disk, is probably the most
important data structure on the disk. It is the first sector on every disk. The location is always track (cylinder)
0, side (head) 0, and sector 1.
The Master Boot Record contains the Partition Table for the disk and a small amount of executable code.
On x86-based computers, the executable code examines the Partition Table, and identifies the system
partition.
The Master Boot Record then finds the system partition's starting location on the disk, and loads an copy of
its Partition Boot Sector into memory. The Master Boot Record then transfers execution to executable code
in the Partition Boot Sector.

Note:
Although there is a Master Boot Record on every hard disk, the executable code in the sector is used
only if the disk is connected to an x86-based computer and the disk contains the system partition.

The example below shows a hex dump of the sector containing the Master Boot Record. The figure shows
the sector in two parts:

The first part is the Master Boot Record, which occupies the first 446 bytes of the sector. The disk
signature (FD 4E F2 14) is at the end of the Master Boot Record code.

The second part is the Partition Table.

Physical Sector:Cyl 0,Side 0,Sector 1


00000000:00 33 C0 8E D0 BC 00 7C -8B F4 50 07 50 1F FB FC .3.....|..P.P..
00000010:BF 00 06 B9 00 01 F2 A5 -EA 1D 06 00 00 BE BE 07 ................
00000020:B3 04 80 3C 80 74 0E 80 -3C 00 75 1C 83 C6 10 FE ...<.t..<.u.....
00000030:CB 75 EF CD 18 8B 14 8B -4C 02 8B EE 83 C6 10 FE .u......L.......
00000040:CB 74 1A 80 3C 00 74 F4 -BE 8B 06 AC 3C 00 74 0B .t..<.t.....<.t.
00000050:56 BB 07 00 B4 0E CD 10 -5E EB F0 EB FE BF 05 00 V.......^.......
00000060:BB 00 7C B8 01 02 57 CD -13 5F 73 0C 33 C0 CD 13 ..|...W.._s.3...
00000070:4F 75 ED BE A3 06 EB D3 -BE C2 06 BF FE 7D 81 3D Ou...........}.=
00000080:55 AA 75 C7 8B F5 EA 00 -7C 00 00 49 6E 76 61 6C U.u.....|..Inval
00000090:69 64 20 70 61 72 74 69 -74 69 6F 6E 20 74 61 62 id partition tab
000000A0:6C 65 00 45 72 72 6F 72 -20 6C 6F 61 64 69 6E 67 le.Error loading
000000B0:20 6F 70 65 72 61 74 69 -6E 67 20 73 79 73 74 65 operating syste
000000C0:6D 00 4D 69 73 73 69 6E -67 20 6F 70 65 72 61 74 m.Missing operat
000000D0:69 6E 67 20 73 79 73 74 -65 6D 00 00 80 45 14 15 ing system...E..
000000E0:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
000000F0:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
00000100:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
00000110:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
00000120:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
00000130:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
00000140:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
00000150:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
00000160:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
00000170:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
00000180:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
00000190:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
000001A0:00 00 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 ................
000001B0:00 00 00 00 00 00 00 00 -FD 4E F2 14 00 00
.........N......
80 01
..
000001C0:01 00 06 0F 7F 96 3F 00 -00 00 51 42 06 00 00 00 .....?...QB....
000001D0:41 97 07 0F FF 2C 90 42 -06 00 A0 3E 06 00 00 00 A....,.B...>....
000001E0:C1 2D 05 0F FF 92 30 81 -0C 00 A0 91 01 00 00 00 .-....0.........
000001F0:C1 93 01 0F FF A6 D0 12 -0E 00 C0 4E 00 00 55 AA ...........N..U.

Hard Drive Partition. Partition Table

The information about primary partitions and an extended partition is contained in the Partition
Table, a 64-byte data structure located in the same sector as the Master Boot Record (cylinder 0,
head 0, sector 1). The Partition Table conforms to a standard layout that is independent of the
operating system. Each Partition Table entry is 16 bytes long, making a maximum of four entries
available. Each entry starts at a predetermined offset from the beginning of the sector, as follows:

Partition 1 0x01BE (446)

Partition 2 0x01CE (462)

Partition 3 0x01DE (478)

Partition 4 0x01EE (494)

The last two bytes in the sector are a signature word for the sector and are always 0x55AA. The
next example is a printout of the Partition Table for the disk shown in an example earlier in this
chapter. When there are fewer than four partitions, the remaining fields are all zeros.
80 01
000001C0:01
000001D0:41
000001E0:C1
000001F0:C1

00
97
2D
93

06
07
05
01

..
0F
0F
0F
0F

7F
FF
FF
FF

96
2C
92
A6

3F
90
30
D0

00
42
81
12

-00
-06
-0C
-0E

00
00
00
00

51
A0
A0
C0

42
3E
91
4E

06
06
01
00

00
00
00
00

00
00
00
55

00
00
00
AA

.....?...QB....
A....,.B...>....
.-....0.........
...........N..U.

The following table describes each entry in the Partition Table. The sample values correspond to the
information for partition 1.
Partition Table Fields
Byte Field Sample
Offset Length Value

Meaning

00

BYTE

Boot Indicator. Indicates whether the partition is the system partition.


Legal values are:
0x80
00 = Do not use for booting.
80 = System partition.

01

BYTE

0x01 Starting Head.

02

6 bytes

0x01

03

10 bytes

0x00

Starting Sector. Only bits 0-5 are used. Bits 6-7 are the upper two bits
for the Starting Cylinder field.
Starting Cylinder. This field contains the lower 8 bits of the cylinder
value. Starting cylinder is thus a 10-bit number, with a maximum value

of 1023.

04

BYTE

System ID. This byte defines the volume type. In Windows NT, it also
0x06 indicates that a partition is part of a volume that requires the use of the
HKEY_LOCAL_MACHINE\SYSTEM\DISK Registry subkey.

05

BYTE

0x0F Ending Head.

06

6 bytes

0x3F

07

Ending Cylinder. This field contains the lower 8 bits of the cylinder
10 bytes 0x196 value. Ending cylinder is thus a 10-bit number, with a maximum value
of 1023.

08

DWORD

3F 00 00
Relative Sector.
00

12

DWORD

51 42 06
Total Sectors.
00

Ending Sector. Only bits 0-5 are used. Bits 6-7 are the upper two bits for
the Ending Cylinder field.

The remainder of this section describes the uses of these fields. Definitions of the fields in the
Partition Table is the same for primary partitions, extended partitions, and logical drives in extended
partitions.

Boot Indicator Field


The Boot Indicator field indicates whether the volume is the system partition. On x-86-based
computers, only one primary partition on the disk should have this field set. This field is used only
on x86-based computers. On RISC-based computers, the NVRAM contains the information for
finding the files to load.
On x86-based computers, it is possible to have different operating systems and different file
systems on different volumes. For example, a computer could have MS-DOS on the first primary
partition and Windows 95, UNIX, OS/2, or Windows NT on the second. You control which primary
partition (active partition in FDISK) to use to start the computer by setting the Boot Indicator field
for that partition in the Partition Table.

System ID Field

For primary partitions and logical drives, the System ID field describes the file system used to
format the volume. Windows NT uses this field to determine what file system device drivers to load
during startup. It also identifies the extended partition, if there is one defined.
These are the values for the System ID field:
Table 3-1 System ID Field Values
Value

Meaning

0x0B
0x0C
0x0E
0x0F

Primary Fat32 partition, using interrupt 13 (INT 13) extensions.


Extended Fat32 partition, using INT 13 extensions.
Primary Fat16 partition, using INT 13 extensions.
Extended Fat16 partition, using INT 13 extensions.

When you create a volume set or a stripe set, Disk Administrator sets the high bit of the System ID
field for each primary partition or logical drive that is a member of the volume.
For example, a FAT primary partition or logical drive that is a member of a volume set or a stripe
set has a System ID value of 0x86. An NTFS primary partition or logical drive has a System ID
value of 0x87.
This bit indicates that Windows NT needs to use the HKEY_LOCAL_MACHINE\SYSTEM\DISK
Registry subkey to determine how the members of the volume set or stripe set relate to each other.
Volumes that have the high bit set can only be accessed by Windows NT.
When a primary partition or logical drive that is a member of a volume set or a stripe set has failed
due to write errors or cannot be accessed, the second most significant bit is set. The System ID byte
is set to C6 in the case of a FAT volume, or C7 in the case of an NTFS volume.
Note
If you start up MS-DOS, it can only access primary partitions or logical drives that have a
value of 0x01, 0x04, 0x05, or 0x06 for the System ID. However, you should be able to delete
volumes that have the other values. If you use a MS-DOS-based low-level disk editor, you
can read and write any sector, including ones that are in NTFS volumes.
On Windows NT Server, mirror sets and stripe sets with parity also require the use of the Registry
subkey HKEY_LOCAL_MACHINE\SYSTEM\DISK to determine how to access the disks.

Starting and Ending Head, Sector, and Cylinder Fields


On x86-based computers, the Starting and Ending Head, Cylinder, and Sector fields on the startup
disk are very important for starting up the computer. The code in the Master Boot Record uses these
fields to find and load the Partition Boot Sector.

The Ending Cylinder field in the Partition Table is ten bits long, which limits the maximum number
of cylinders that can be described in the Partition Table to 1024. The Starting and Ending Head
fields are one byte long, which limits this field to the range 0 255. The Starting and Ending Sector
field is 6 bits long, limiting its range to 0 63. However, sectors start counting at 1 (versus 0 for the
other fields), so the maximum number of sectors per track is 63.
Since current hard disks are low-level formatted with the industry standard 512-byte sector size, the
maximum capacity disk that can be described by the Partition Table can be calculated as follows:
MaxCapacity = (sector size) x (sectors per track) x (cylinders) x (heads)

Substituting the maximum possible values yields:


512 x 63 x 1024 x 256 = 8,455,716,864 bytes or 7.8 GB

The maximum formatted capacity is slightly less than 8 GB.


However, the maximum cluster size that you can use for FAT volumes when running Windows NT
is 64K, when using a 512 byte sector size. Therefore, the maximum size for a FAT volume is 4 GB.
If you have a dual-boot configuration with Windows 95 or MS-DOS, FAT volumes that might be
accessed when using either of those operating systems are limited to 2 GB. In addition, Macintosh
computers that are viewing volumes on a computer running Windows NT cannot see more than 2
GB. If you try to use a FAT volume larger than 2 GB when running MS-DOS or Windows 95, or
access it from a Macintosh computer, you might get a message that there are 0 bytes available. The
same limit applies to OS/2 system and boot partitions.
The maximum size of a FAT volume on a specific computer depends on the disk geometry, and the
maximum values that can fit in the fields described in this section. The next table shows the typical
size of a FAT volume when translation is enabled, and when it is disabled. The number of cylinders
in both situations is 1024.
Translation
mode

Number of
heads

Sectors per
track

Maximum size for system or boot


partition

Disabled

64

32

1 GB

Enabled

255

63

4 GB

Note
RISC-based computers do not have a limit on the size of the system or boot partitions.

If a primary partition or logical drive extends beyond cylinder 1023, all of these fields will contain
the maximum values.
Relative Sectors and Number of Sectors Fields
For primary partitions, the Relative Sectors field represents the offset from the beginning of the disk
to the beginning of the partition, counting by sectors. The Number of Sectors field represents the
total number of sectors in the partition. For a description of these fields in extended partitions, see
the section Logical Drives and Extended Partitions.
Windows NT uses these fields to access all partitions. When you format a partition when running
Windows NT, it puts data into the Starting and Ending Cylinder, Head, and Sector fields only for
backward compatibility with MS-DOS and Windows 95, and to maintain compatibility with the
BIOS interrupt (INT) 13 for startup purposes.

rimary Partition. Extended Partition. Logical Drives


Logical Drives and Extended Partitions
When more than four logical disks are required on a single physical disk, the first partition should
be a primary partition. The second partition can be created as an extended partition, which can
contain all the remaining unpartitioned space on the disk.
Note:
A primary partition is one that can be used as the system partition. If the disk does not
contain a system partition, you can configure the entire disk as a single, extended partition.
Some computers create an EISA configuration partition as the first partition on the hard disk.
Windows NT detects an extended partition because the System ID byte in the Partition Table entry
is set to 5. There can be only one extended partition on a hard disk.
Within the extended partition, you can create any number of logical drives. As a practical matter,
the number of available drive letters is the limiting factor in the number of logical drives that you
can define.
When you have an extended partition on the hard disk, the entry for that partition in the Partition
Table (at the end of the Master Boot Record) points to the first disk sector in the extended partition.
The first sector of each logical drive in an extended partition also has a Partition Table, which is the
last 66 bytes of the sector. (The last two bytes of the sector are the end-of-sector marker.)
These are the entries in an extended Partition Table:

The first entry is for the current logical drive.

The second entry contains information about the next logical drive in the extended partition.

Entries three and four are all zeroes.

This format repeats for every logical drive. The last logical drive has only its own partition entry
listed. The entries for partitions 2-4 are all zeroes.
The Partition Table entry is the only information on the first side of the first cylinder of each logical
drive in the extended partition. The entry for partition 1 in each Partition Table contains the starting
address for data on the current logical drive. And the entry for partition 2 is the address of the sector
that contains the Partition Table for the next logical drive.
The use of the Relative Sector and Total Sectors fields for logical drives in an extended partition is
different than for primary partitions. For the partition 1 entry of each logical drive, the Relative
Sectors field is the sector from the beginning of the logical drive that contains the Partition Boot
Sector. The Total Sectors field is the number of sectors from the Partition Boot Sector to the end of
the logical drive.
For the partition 2 entry, the Relative Sectors field is the offset from the beginning of the extended
partition to the sector containing the Partition Table for the logical drive defined in the Partition 2
entry. The Total Sectors field is the total size of the logical drive defined in the Partition 2 entry.
Note:
If a logical drive is part of a volume set, the Partition Boot Sector is at the beginning of the
first member of the volume set. Other members of the volume set have data where the
Partition Boot Sector would normally be located.

You might also like