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:

The last two bytes in the sector are a signature word for the sector and are always 0x55AA.

The next figure is a printout of the Partition Table for the disk shown in Figure 3.4. When there are fewer than four partitions, the remaining fields are all zeros.


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.

Figure 3.6. Partition Table from an x86-based computer

The following table describes each entry in the Partition Table. The sample values correspond to the information for partition 1 in Figure 3.6.

Table 3.1 Partition Table Fields

Byte Offset

Field Length

Sample Value


Meaning

00

BYTE

0x80

Boot Indicator. Indicates whether the partition is the system partition. Legal values are:
00 = Do not use for booting.
80 = System partition.

01

BYTE

0x01

Starting Head.

02

6 bits

0x01

Starting Sector. Only bits 0-5 are used. Bits 6-7 are the upper two bits for the starting cylinder field.

03

10 bits

0x00

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

0x06

System ID. This byte defines the volume type. In Windows NT, it also 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 bits

0x3F

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

07

10 bits

0x196

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

08

DWORD

3F 00 00 00

Relative Sector.

12

DWORD

51 42 06 00

Total Sectors.


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 x86-based computers, only one partition on the disk should have this field set. This field is used only on x86-based computers. On RISC-based computers, the nonvolatile RAM (NVRAM) contains the information for finding the files to load.

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:

Value

Meaning

0x01

12-bit FAT partition or logical drive. The number of sectors in the volume is fewer than 32680.

0x04

16-bit FAT partition or logical drive. The number of sectors is between 32680 and 65535.

0x05

Extended partition. See section titled "Logical Drives and Extended Partitions," presented later in this chapter, for more information.

0x06

BIGDOS FAT partition or logical drive.

0x07

NTFS partition or logical drive.


Figure 3.6, presented earlier in this section, has examples of a BIGDOS FAT partition, an NTFS partition, an extended partition, and a 12-bit FAT partition.

When you create a volume set, stripe set, mirror set, or stripe set with parity, 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 one of these volumes 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 relate to each other. Volumes that have the high bit set can only be accessed by Windows NT. This bit is called the fault-tolerant (FT) bit.

When a primary partition or logical drive that is a member of one of these volumes 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, 0x5, or 0x6 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.

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 cylinder number that can be described in the Partition Table to 1023. 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 (GB)

This calculation results in a 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 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," presented later in this chapter.

Windows NT uses these fields to access all volumes. When you format a volume 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.

See the section titled "Using Disks With More Than 1024 Cylinders (x86-based Computers)," presented later in this chapter, for more information about the use of these fields.

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:

This format repeats for every logical drive. The last logical drive has only its own 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.

This Disk Administrator screen shot shows a disk having an extended partition. The extended partition contains a volume set (drive E), two logical drives (drives I and K), and 4 MB of unallocated space. This screen shot is identical to the one shown in Figure 3.4.

The following example is a printout from the DiskMap program of the information in the Master Boot Record (the section titled MBR) and the extended Partition Table entries (the sections titled EBR) for the disk configuration shown in the preceding Disk Administrator screen shot. For information about DiskMap, see Chapter 7, "Disk, File System, and Backup Utilities."


MBR: Starting Ending System Relative Total Cylinder Head Sector Cylinder Head Sector ID Sector Sectors * 0 1 1 406 15 63 0x06 63 410193 407 0 1 812 15 63 0x07 410256 409248 813 0 1 914 15 63 0x05 819504 102816 915 0 1 934 15 63 0x01 922320 20160 EBR: (sector 819504) Starting Ending System Relative Total Cylinder Head Sector Cylinder Head Sector ID Sector Sectors 813 1 1 832 15 63 0x87 63 20097 833 0 1 848 15 63 0x05 20160 16128 EBR: (sector 839664) Starting Ending System Relative Total Cylinder Head Sector Cylinder Head Sector ID Sector Sectors 833 1 1 848 15 63 0x01 63 16065 849 0 1 872 15 63 0x05 36288 24192 EBR: (sector 855792) Starting Ending System Relative Total Cylinder Head Sector Cylinder Head Sector ID Sector Sectors 849 1 1 872 15 63 0x07 63 24129 873 0 1 905 15 63 0x05 60480 33264 EBR: (sector 879984) Starting Ending System Relative Total Cylinder Head Sector Cylinder Head Sector ID Sector Sectors 873 1 1 905 15 63 0x87 63 33201 0 0 0 0 0 0 0x00 0 0