grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grub2 and hybrid MBR booting


From: Elliott, Robert (Server Storage)
Subject: grub2 and hybrid MBR booting
Date: Tue, 29 Jun 2010 18:37:29 +0000

I successfully ran ubuntu 10.04 (which uses grub2) on a 4 TB drive 
(presented by a RAID controller) on a system with legacy BIOS.  The 
drive got partitioned as GPT; a BIOS boot partition was installed; 
and grub stage 1 contains the 8-byte LBA of the BIOS boot partition 
hardcoded into its 440 bytes of x86 boot code, so it can load the 
code in that BIOS boot partition.

That works pretty well, but requires any program that moves the BIOS 
boot partition to know that grub is pointing to it and also adjust 
that 8-byte LBA value stored in LBA 0.

In the UEFI Working Group (which defines GPT) and the T13 (ATA) standards 
bodies, we defined a slightly different method:  the GPT partition record 
now includes a Legacy BIOS Bootable bit that can be set for a partition 
like the BIOS boot partition, and the x86 boot code in LBA 0 can search 
through the GPT partition table for a partition with that bit set to 1 
(rather than contain a hardcoded LBA).  The algorithm is documented in 
T13 EDD-4 revision 2 and later (see
http://t13.org/Documents/MinutesDefault.aspx?DocumentType=4&DocumentStage=1).

Would grub2 consider switching to that modified algorithm?

H Peter Anvin has implemented it in syslinux-4.00-pre48 (see
http://syslinux.zytor.com/wiki/index.php/The_Syslinux_Project). The boot code 
doesn't have enough room to verify the GPT CRC and perform all the possible 
GPT verification checks, but it can definitely walk through the structure 
and find the boot partition.


I got some initial offline replies from Colin Watson, who suggested 
forwarding our thread to the list:

Colin:
> I'm just one GRUB 2 developer, but I'm certainly interested in things
> that improve standards-compliance and make things more reliable.  I like
> the look of this new scheme.

> Right now, the GRUB 2 boot code has no bytes free (well, it has eight
> bytes free upstream and no bytes free in Ubuntu, so I'm rather conscious
> of that).  I notice that syslinux uses a separate chunk of boot code for
> this new algorithm, so we could do that in GRUB 2 as well.

> Would you agree that the right way to decide whether to use the new boot
> code is to check whether the BIOS Boot Partition has the Legacy BIOS
> Bootable bit set?  I assume it was previously reserved and always 0.

RE: Correct.

> Do you know if anyone has contacted the GNU Parted developers about
> implementing support for this?  We'd need that in order to use it in
> Debian and Ubuntu, and I guess most other GNU/Linux distributions would
> need this too.  I can do this if nobody else has.

RE: H. Peter recently said he would bring it up with them.  

Colin:
> The specification doesn't seem to say anything about what happens in the
> event of multiple partition entries having the Legacy BIOS Bootable bit
> set.  syslinux simply bails out with the error "Multiple active
> partitions".  Is this as envisioned by the standards bodies?

RE: No, more than partition could have the bit set to one.  I 
envisioned the boot code starting with the first such partition, then 
looping back to the next if there is an error reading from the 
first partition.

---
Rob Elliott    HP ISS Platform Technology - Server Storage





reply via email to

[Prev in Thread] Current Thread [Next in Thread]