[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grub2 and hybrid MBR booting
Elliott, Robert (Server Storage)
grub2 and hybrid MBR booting
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
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:
> 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.
> 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.
> 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
Rob Elliott HP ISS Platform Technology - Server Storage
|[Prev in Thread]
||[Next in Thread]|
- grub2 and hybrid MBR booting,
Elliott, Robert (Server Storage) <=