Extended boot record
From Wikipedia, the free encyclopedia
An Extended Boot Record (EBR), or Extended Partition Boot Record (EPBR)1, is a descriptor for a logical partition under the common DOS disk drive partitioning system. In that system, when one (and only one) partition record entry in the Master Boot Record (MBR) is designated an "extended partition," then that partition can be subdivided into a number of logical drives. The actual structure of that extended partition is described by one or more EBRs, which are located inside the extended partition. The first (and sometimes only) EBR will always be located on the very first sector of the extended partition.
Unlike primary partitions, which are all described by a single partition table within the MBR, and thus limited in number, each EBR precedes the logical partition it describes.2 If another logical partition follows, then the first EBR will contain an entry pointing to the next EBR; thus, multiple EBRs form a sort of chain from the first to the next, and finally to the last one.3 This means the number of logical drives that can be formed within an extended partition is limited only by the amount of available disk space.4
Contents |
[edit] EBR structure and values
EBRs have essentially the same structure as the MBR; except only the first two entries of the partition table are supposed to be used, besides having the mandatory boot record signature (or magic number) of 0xAA55
at the end of the sector. As always, this 2-byte signature appears in a disk editor as 55h first and AAh last, because IBM-compatible PCs store hexadecimal Words in reverse order5 (see table below).
[edit] Structures
Offsets ( within EBR sectors ) |
Contents | Size in bytes |
|||
---|---|---|---|---|---|
Hex | Oct | Dec | |||
000 - 1BD |
000 - 675 |
000 - 445 | Generally unused; normally filled with zero-bytes | 446 | |
18A - 192 |
612 - 622 |
394 - 402 | Possible IBM Boot Manager menu entry6 | 9 | |
1BE - 1CD |
676 - 715 |
446 - 461 | Partition Table's First entry | 16 | |
1CE - 1DD |
716 - 735 |
462 - 477 | Partition Table's Second entry | 16 | |
1DE - 1FD |
736 - 775 |
478 - 509 | Unused, but should be filled with zero-bytes | 32 | |
1FE |
776 |
510 | 55h | Boot Record signature: 0xAA55 (AA55h) |
2 |
1FF |
777 |
511 | AAh | ||
EBR, total size: 446 + 16 +16 +32 + 2 = | 512 |
Offsets ( within each entry ) |
Byte Count | Description |
---|---|---|
0 | 1 | Boot indicator (80h for active; otherwise, 00h) |
1 - 3 | 3 | Starting CHS (Cylinder, Head, Sector) values |
4 | 1 | Partition-type descriptor |
5 - 7 | 3 | Ending CHS (Cylinder, Head, Sector) values |
8 - 11 | 4 | Starting Sector |
12 - 15 | 4 | Partition Size (in Sectors) |
[edit] Values
The following are general rules that apply only to values found in the 4-byte fields of an EBR's partition table entries (cf. Tables above). These values depend upon the partitioning tool(s) used to create or alter them, and in fact, most operating systems that use the Extended partitioning scheme (including Microsoft DOS and Windows, and Linux) ignore the "Number of sectors" value in entries which point to another EBR sector; with only one exception: that value must be one or greater for Linux operating systems.
The first entry of an EBR partition table points to the logical partition belonging to that EBR:
-
- Starting Sector = relative offset between this EBR sector and the first sector of the logical partition
- Note: This will be the same value for each EBR on the same hard disk; usually 63.
- Number of Sectors = total count of sectors for this logical partition
- Note: The unused sectors in the same track as the EBR, are not considered part of the logical partition for this count value.
The second entry of an EBR partition table will contain zero-bytes if it's the last EBR in the extended partition; otherwise, it points to the next EBR in the EBR chain:
-
- Starting Sector = relative address of next EBR within extended partition
- or: Starting Sector = LBA address of next EBR minus LBA address of extended partition's first EBR
-
- Number of Sectors = total count of sectors for next logical partition, but count starts from the next EBR sector
- Note: Unlike the first entry in an EBR's partition table, this Number of Sectors count includes the next logical partition's EBR sector along with the other sectors in its otherwise unused track. (Compare Diagram 1 and 2 below.)
Remarks:
First, the diagrams above are not to scale: The thin white lines between each "EBR" and its logical "partition" represent the remainder of an unused area usually 63 sectors2 in length; including the single EBR sector (shown at a greatly exaggerated size).
Also, on some systems, a large gap of unused space may exist between the end of a logical partition and the next EBR, or between the last logical partition and the end of the whole extended partition itself, if any previously created logical partition has been deleted or resized (shrunk).
[edit] Examples
[edit] Example 1 (unreal)
The first example shows an extended partition with 6,000 sectors and 3 logical partitions.
Remark: Neither a tiny extended partition with only 3 MB nor a hard drive with 20 sectors per track are realistic but these values have been chosen to make this example more readable.
[edit] Example 2 (unreal)
The same extended partition as in example 1 after the 2nd logical partition was deleted and the last one was shortened.
[edit] Footnotes
- Note 1: This term is used by PowerQuest's (now Symantec) diagnostic software programs, such as their PartitionInfo utility (included with Partition Magic), when extended partition information is displayed.
- Note 2: The EBR is located on the very first sector of an otherwise unused area which is equal to the number of sectors per track; normally, 63 sectors. In this regard, each logical partition mimicks the layout of a hard disk's structure for its first primary partition, since the MBR is located on the very first sector of the disk, the first sector of Track 0 (normally followed by 62 unused sectors) and then the boot sector of its first primary partition.
- Note 3: Therefore, any operating system or utility program that must access or enumerate all logical drive partitions, must follow this chain of entries until the last EBR, containing only one entry, has been read.
- Note 4: Under most DOS and some Windows operating systems, the number of logical drives in an extended partition was limited to 23, because the FDISK program couldn't create any more drives than it could assign a drive letter to; thus, assuming C: is a primary drive, the DOS drive letters D: through Z: allow for only 23 more drives. Under Windows NT and later, an unlimited number of logical partitions can be created using the Computer Management's, Disk Management Extension; though in practice, users rarely created more than 23, since the Windows NT shell (user interface) was still limited to accessing only those drives with an A: through Z: drive letter. Some newer operating systems may implement an AA: through ZZ: drive lettering scheme; making it possible to access over 670 logical drives.
- Note 5: This is called little-endian notation; in which the least significant byte of a number is stored in a lower memory location than the more significant bytes, and finally the most significant byte is last (higher in memory).
- Note 6: The IBM Boot Manager (included with OS/2 operating systems and some early versions of Partition Magic), adds at least one 9-byte entry (starting at offset 0x18A) to each EBR sector. The entry is comprised of a flag value byte (indicating if the partition is on the IBM Boot Manager menu) followed by an 8-byte ASCII string which is the name to be used on the menu. If the partition is not included on the boot menu (such as data only partitions), the flag byte is zero; in which case, the following 8-byte field may contain an ASCII representation of that partition's starting sector number (in hexadecimal).
[edit] References
[edit] See also
[edit] External links
- HxD - A freeware Windows disk editor which can be used to explore and study sector contents, such as an EBR sector.