public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Harvey Chapman <hchapman-linux-kernel@3gfp.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Matching hard disks to BIOS boot order
Date: Fri, 12 Jun 2009 15:38:24 -0700	[thread overview]
Message-ID: <4A32D8E0.5090900@zytor.com> (raw)
In-Reply-To: <20090612085341.04ffcae2@lxorguk.ukuu.org.uk>

Alan Cox wrote:
> On Fri, 12 Jun 2009 00:26:16 -0400
> Harvey Chapman <hchapman-linux-kernel@3gfp.com> wrote:
> 
>> Is there a way to figure out which hard disks match the BIOS boot order?
>>
>> I'm trying to tell a Linux program which disk to use based on the disk 
>> numbers (0,1,...) used by Windows. The best solution I've found so far 
>> is disk serial number, but that hasn't been terribly reliable for other 
>> reasons.
> 
> There is a BIOS interface for this on newer systems, although the kernel
> doesn't capture enough data to make it completely reliable below EDD 3.0
> (in theory if we grabbed a few more bits we could do EDD 1.x as well)
> 
> Most PCs today do EDD 3.0 however
> 

Actually, the best option is to completely forget about BIOS boot order
-- on some systems it can literally change from one boot to the next --
and instead rely on MBR signatures.  As far as I know, Windows requires
all hard drives to have unique signatures and will "rebrand" the disks
to make it so if necessary.

The MBR signature is 4 bytes starting at offset 440 decimal.

	-hpa

      reply	other threads:[~2009-06-12 22:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-12  4:26 Matching hard disks to BIOS boot order Harvey Chapman
2009-06-12  7:53 ` Alan Cox
2009-06-12 22:38   ` H. Peter Anvin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A32D8E0.5090900@zytor.com \
    --to=hpa@zytor.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=hchapman-linux-kernel@3gfp.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox