Master Boot Record - Disk Identity

Disk Identity

In addition to the bootstrap code and a partition table, master boot records may contain a Windows NT disk signature. This is a 32-bit value that is intended to identify uniquely the disk medium (as opposed to the disk unit — the two not necessarily being the same for removable hard disks).

The disk signature was introduced by Windows NT version 3.5, but is now used by several operating systems, including the Linux kernel version 2.6 and later. Linux tools can use the NT disk signature to determine which disk the machine booted from.

Windows NT (and later Microsoft operating systems) uses the disk signature as an index to all the partitions on any disk ever connected to the computer under that OS; these signatures are kept in registry keys, primarily for storing the persistent mappings between disk partitions and drive letters. It may also be used in BOOT.INI files (though most do not), to describe the location of bootable Windows NT (or later) partitions. One key (among many) where NT disk signatures appear in a Windows 2000/XP registry is:

HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\

If a disk's signature stored in the MBR was A8h E1h B9h D2h (in that order) and its first partition corresponded with logical drive C: under Windows, then the REG_BINARY data under the key value DosDevices\C: would be:

A8h E1h B9h D2h 00h 7Eh 00h 00h 00h 00h 00h 00h

The first four bytes are said disk signature. (Note: In other keys, these bytes may appear in reverse order from that found in the MBR sector.) These are followed by eight more bytes, forming a 64-bit integer, in little endian notation, which are used to locate the byte offset of this partition. In this case, 00h 7Eh corresponds to the hexadecimal value 7E00h (32,256). If we assume the drive in question reports a sector size of 512 bytes, then dividing this byte offset by 512 results in 63, which is the physical sector number (or LBA) containing the first sector of the partition (unlike the sector count used in the sectors value of CHS tuples, which counts from one, the absolute or LBA sector value starts counting from zero).

If this disk had another partition with the values 00h F8h 93h 71h 02h following the disk signature (under, e.g., the key value \DosDevices\D:), it would begin at byte offset 00027193F800h (10,495,457,280), which is also the first byte of physical sector 20,498,940.

Starting with Windows Vista, the disk signature is also stored in the Boot Configuration Data (BCD) store and the boot process depends on it. If the disk signature changes, cannot be found or has a conflict, Windows is unable to boot. Unless Windows is forced to use the overlapping part of the LBA address of the Advanced Active Partition entry as pseudo-disk signature, Windows' usage is conflictive with the Advanced Active Partition feature of PTS-DOS 7 and DR-DOS 7.07, in particular if their boot code is located outside the first 8 GB of the disk, so that LBA addressing must be used.

Read more about this topic:  Master Boot Record

Famous quotes containing the words disk and/or identity:

    Unloved, that beech will gather brown,
    This maple burn itself away;

    Unloved, the sun-flower, shining fair,
    Ray round with flames her disk of seed,
    And many a rose-carnation feed
    With summer spice the humming air;
    Alfred Tennyson (1809–1892)

    There is a terrible blindness in the love that wants only to accommodate. It’s not only to do with omissions and half-truths. It implants a lack of being in the speaker and robs the self of an identity without which it is impossible for one to grow close to another.
    Alexander Theroux (b. 1940)