|
|
|
|
|
Partition Tables (Revised)
By: Walter Metcalf
Date: 06/28/00
In the preceding series we made several references to the
"partition table". Therefore I thought this would be an appropriate time to supply some additional detail
on this critical system component. Basically a partition table is a special location on
the hard drive containing the partition information. As always with computers, however,
it's not that simple. In fact it can get very complex, but in this article I'll
try to stick with the basic information.
First of all there are two distinct kinds of partition tables, and there can
be many of the them on the same hard drive.
-
Master Partition Table
-
When most people use the term "partition table," this is the one they
mean. Before we go further, we need look at the overall layout of the hard drive.
(The following information is true regardless of operating system used on the drive.
On some otherwise excellent sites, the authors are familiar only with DOS and DOS-based
operating systems, and they write in such a way as to be confusing to those of us
familiar with multiple operating systems and non-DOS-based operating systems such
as OS/2 and Linux. Care is needed when interpreting the information on such sites.)
-
Master Boot Record (MBR)
-
Also called the master boot sector, or simply boot sector, the MBR
is the very first physical record (cylinder 0, head 0, sector 1) on any hard
drive as it comes from the factory.
-
The MBR contains two vital components:
-
Bytes 0 - 445 contain the Master Boot Code
-
Bytes 446 - 509 contain the Master Partition Table
-
The Master Partition Table is 64 bytes in length and contain 4 entries, one for
each primary partition. Since each partition entry requires 16 bytes, a hard drive
can have a maximum of 4 primary partitions.
-
Each partition entry contains:
-
Byte indicating whether or not the partition is active (i.e. startable).
-
The starting cylinder, head, and sector of the partition
-
The ending cylinder, head, and sector of the partition
-
The number of sectors in the partition
-
Byte indicating how the partition is formatted
-
Finally, there is a two-byte signature identifying this sector as a boot sector.
-
Extended Partition Table
-
This structure exists only if the physical drive contains an extended partition,
that is, a primary partition that is subdivided into logical partitions, or drives.
The information about the extended partition is stored in the master partition
table. In an extended partition table entry, the starting address links to an extended
partition table. The format of the extended partition table is identical to
that of the master partition table except that it contains at most two entries.
If the extended partition contains only one logical drive, then there is a single
entry pointing to the logical boot sector for that drive. If there is more than
one logical drive, the extended partition table contains a second entry which points
to yet another extended partition table whose first entry points to the second logical
drive, and so on until all logical drives are linked. (One writer, Andrew Pitonyak,
has stated an
extended partition table can contain two logical drives and two extended partitions.
I have not been able to confirm this. At best, this would be an unusual situation.)
There can be a maximum of 23 extended partition tables on a physical hard drive.
-
Volume Boot Sector
While the volume boot sector is technically not part of the partition
table structures, I'm adding it for completeness. Every volume (i.e. logical drive)
has one, located, apparently, at the end of the drive's track 0, which is otherwise
hidden from the system. It is to this record that the partition table entry links--not
to the actual code or data.
The volume boot sector contains two items:
-
Disk Parameter Block
This information contains detailed information about the logical drive, such
as its type, length, and name.
-
Volume Boot Code
This contains the boot program specific to the drive if active; otherwise it
is ignored.
Walter Metcalf
For Further Reading: Hard Disk Logical Structures and File Systems, The PC Guide, © 1997-98 Charles M. Kozierok Inside the High Performance File System, EDM/2, December 1996, by Dan Bridges The Partition Table, EDM/2, March 1998, by Andrew Pitonyak Removing or Disarming PC Viruses Common sense talk about antivirus hype as well as discussion about where partition table fits into virus problem.
Next week: System Commander 2000: A Review
Notes
1 This the OS/2 FDISK command format. Note that it is case sensitive and different from the DOS FDISK command format.
Unless otherwise noted, all content on this site is Copyright © 2004, VOICE
|
|
|
|
|
|
|