Re: [RFC][PATCH 2.4] EDD 4-byte MBR disk signature for the boot disk

From: Andries Brouwer
Date: Tue Oct 14 2003 - 05:46:40 EST


On Fri, Oct 10, 2003 at 09:05:47AM -0500, Matt Domsch wrote:

> There are 4 bytes in the MSDOS master boot record, at offset 0x228,
> which may contain a per-system-unique signature.

You mean 0x1b8.

Yes, this area is used by some Microsoft systems.
I wrote somewhere:

-------------------------------------------------
Just before the partition table some operating systems save some
interesting stuff. For example, DRDOS stores a password starting
at offset 0x1b6.

Windows NT stores a 4-byte "disk signature" or "volume ID" starting at
offset 0x1b8. It is used to map drive letters to disks: in the
HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices registry item the drive letter
is coupled with this disk signature. It is used as a disk label to map
disk info to disks in the HKEY_LOCAL_MACHINE\SYSTEM\DISK registry item.
This signature is generated by the Disk Administrator when it initializes
the disk, unless there already was a nonzero value there.

Grub had a 4-byte stage2 start address at 0x1b8, and a 2-byte version
at 0x1bc, but recent versions preserve 0x1b8-0x1bd. Also LILO v20 and later
preserves this area.
-------------------------------------------------

Probably you can add to this.

> This is useful in the case where the BIOS is not EDD3.0 compliant,
> thus doesn't provide the PCI bus/dev/fn and IDE/SCSI location of the
> boot disk, yet you need to know which disk is the boot disk.

An old idea to distinguish disks is to store an md5sum of the first sector.
That would partly remove the dependence on one particular boot sector format.

Can you remind me why you want to retrieve the boot disk?
(Maybe we booted from ethernet or CDROM or USB device..)

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/