Skip to contentSkip to conversation

GPT BIOS boot partition and installing to a partition

DISCUSSION Dave Vasilevsky 4 participants 8 messages Oct 31, 2009 – Nov 1, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

On my GPT-partitioned MacBook, I seem to have two options for booting with grub-pc:

1. Install grub to the start of an existing partition. This coexists well with the rEFIt boot menu, but requires blocklists to load core.img.
2. Use a BIOS boot partition. This allows embedding core.img, but installs to the MBR and makes rEFIt unhappy.

I had the idea that we could get the advantages of both: Install the boot-image to an existing partition, but load core.img from a BIOS boot partition. With some creative hex-editing I got this working without much difficulty.

Is there a technical reason why grub doesn't support this setup? If I were to write a patch allowing this, what behaviour would be
preferred: Should 'grub-setup (hdX,Y)' automatically use a BIOS boot partition if one exists, or should a command-line flag be required?

Dave Vasilevsky

#2 lore raw
Quoted 10 lines · Dave Vasilevsky

On my GPT-partitioned MacBook, I seem to have two options for booting with grub-pc:

1. Install grub to the start of an existing partition. This coexists well with the rEFIt boot menu, but requires blocklists to load core.img.
2. Use a BIOS boot partition. This allows embedding core.img, but installs to the MBR and makes rEFIt unhappy.

On EFI system try grub-efi.

Quoted 11 lines

I had the idea that we could get the advantages of both: Install the boot-image to an existing partition, but load core.img from a BIOS boot partition. With some creative hex-editing I got this working without much difficulty.

Is there a technical reason why grub doesn't support this setup? If I were to write a patch allowing this, what behaviour would be
preferred: Should 'grub-setup (hdX,Y)' automatically use a BIOS boot partition if one exists, or should a command-line flag be required?

It may be a good idea but the best way is to use first sector of BPB for this. But the usability is limited. For EFI systems we have grub-efi and for BIOS boot you still need a specially adapted MBR for it anyway

Quoted 9 lines

Dave Vasilevsky

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 3 lines
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git 
#3 lore raw
Quoted 1 line · phcoder

On EFI system try grub-efi.

I have indeed tried grub-efi, you can see the notes I left here:
https://help.ubuntu.com/community/MactelSupportTeam/EFI-Boot-Mactel#MacBook4,1
. Unfortunately inability to use both accelerated X and the console makes me prefer grub-pc for the moment. I appreciate all the work you've put into grub-efi though, it's great to see it improving.

Quoted 2 lines

the best way is to use first sector of BPB for
this. But the usability is limited.

I'm not sure I'm understanding, isn't the BPB just a few dozen bytes in the boot sector? Some filesystems have a bit more room, but usually not very much. The advantage of using the BIOS Boot Partition is that you can embed the entire core.img, no?

Quoted 1 line

for BIOS boot you still need a specially adapted MBR for it anyway

Agreed that this is sub-optimal, but on my system it's the lesser of evils for now.

Cheers,
Dave

#4 lore raw
Quoted 12 lines · Dave Vasilevsky
Quoted 2 lines · phcoder

On EFI system try grub-efi.

I have indeed tried grub-efi, you can see the notes I left here:
https://help.ubuntu.com/community/MactelSupportTeam/EFI-Boot-Mactel#MacBook4,1
. Unfortunately inability to use both accelerated X and the console makes me prefer grub-pc for the moment. I appreciate all the work you've put into grub-efi though, it's great to see it improving.

Workaround for your problem is described here:
http://grub.enbug.org/TestingOnMacbook
For the long run linux has to be fixed.

Quoted 10 lines
Quoted 3 lines

the best way is to use first sector of BPB for
this. But the usability is limited.

I'm not sure I'm understanding, isn't the BPB just a few dozen bytes in the boot sector? Some filesystems have a bit more room, but usually not very much. The advantage of using the BIOS Boot Partition is that you can embed the entire core.img, no?

It was a typo. I meant BBP (BIOS Boot Partition)

Signature · 3 lines
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git 
#5 lore raw
Quoted 2 lines · phcoder

Workaround for your problem is described here:
http://grub.enbug.org/TestingOnMacbook

Are you talking about fix_video? When I tested, without fix_video I could use the console, but X was slow. With fix_video, X was accelerated, but the console was scrambled as soon as X started.

Quoted 1 line
Quoted 1 line
Quoted 1 line

the best way is to use first sector of [BIOS Boot Partition]

This only works if the BBP is in the MBR. In my configuration, there are already 4 partitions in the MBR, with no room for the BBP. That's why I want to embed the boot-image in another partition, and have it pass control to the BBP.

Dave

#6 lore raw
Quoted 11 lines · Dave Vasilevsky
Quoted 3 lines · phcoder

Workaround for your problem is described here:
http://grub.enbug.org/TestingOnMacbook

Are you talking about fix_video? When I tested, without fix_video I could use the console, but X was slow. With fix_video, X was accelerated, but the console was scrambled as soon as X started.

This is X bug then

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

the best way is to use first sector of [BIOS Boot Partition]

This only works if the BBP is in the MBR. In my configuration, there are already 4 partitions in the MBR, with no room for the BBP. That's why I want to embed the boot-image in another partition, and have it pass control to the BBP.

GRUB2 doesn't need BBP to be in pseudo-MBR to boot

Quoted 9 lines

Dave

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 3 lines
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git 
#7 lore raw
In reply to Dave Vasilevsky
Quoted 7 lines · Dave Vasilevsky
Quoted 2 lines · phcoder

Workaround for your problem is described here:
http://grub.enbug.org/TestingOnMacbook

Are you talking about fix_video? When I tested, without fix_video I could use the console, but X was slow. With fix_video, X was accelerated, but the console was scrambled as soon as X started.

I have got it working with fix_video and with a working intel driver, with accelerated 3d on a fedora 12 .

here is the grub entry :

menuentry "Fedora boot" {
    root=(hd0,2)
    fix_video
    loadbios /EFI/grub/vbios.bin /EFI/grub/int10.bin
    search -s -f /vmlinuz-2.6.31.5-96.fc12.i686.PAE
    linux /vmlinuz-2.6.31.5-96.fc12.i686.PAE ro
root=/dev/mapper/vg_akroma-lv_root nomodeset rhgb=0
    initrd /initramfs-2.6.31.5-96.fc12.i686.PAE.img
}

Even plymouth is working fine.

The xorg driver is the following :
xorg-x11-drv-intel-2.9.1-1.fc12.i686

Signature · 1 line
Michael Scherer
#8 lore raw
In reply to Dave Vasilevsky
Quoted 6 lines · Dave Vasilevsky

On my GPT-partitioned MacBook, I seem to have two options for booting with grub-pc:

1. Install grub to the start of an existing partition. This coexists well with the rEFIt boot menu, but requires blocklists to load core.img.

Why? Can't you fix rEFIt instead?

Quoted 2 lines

2. Use a BIOS boot partition. This allows embedding core.img, but installs to the MBR and makes rEFIt unhappy.

That will lead to trouble. The BBP is a shared resource, like MBR. If installing GRUB to a partition made use of it, it could overwrite other things, which users wouldn't appreciate.

Besides, the whole notion of "installing a bootloader to a partition" is specific to DOS-style labels anyway, and used only for compatibility with Microsoft. There isn't any real benefit in trying to archieve the same thing on GPT.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."