#169 Fail to boot with GRUB2-loader partitions

Dick Hamlet

Context: rEFIt 0.14 with kubuntu 10.04 on a duo Mac Mini, triple boot with Mac OSX, kubuntu, WindowsXP.
Setup essentially that suggested by ashley@csse.uwa.edu.au, whose instructions work perfectly with (say) kubuntu 9.04 using GRUB.
With a GRUB2 loader in the partition, there are various weird effects of some icons booting and others not, or booting apparently
the wrong system, and interacting with the stage1 loader in the MBR. I believe all of these can be traced to a failure to boot
from a GRUB2 partition. In attempting to fix this on the mistaken impression that the trouble is in GRUB, the MBR and partition
boot records get messed about, leading to other weird effects. (It has also been suggested that an ext4 (instead of ext3) file system
may be at fault, but I haven't investigated that. One gets tired of re-installation...)
It is a work-around for creating a ubuntu 10.04 system to add a spurious extra Linux partition at the end (beyond the four
of the MBR partition table, put a GRUB system (say kubuntu 9.04) there, with its loader on the partition, not the MBR,
then use the "boot" program to copy the GRUB loader from this spurious partition to the others that won't boot. The
drawback is that all the GRUB control files reside in the spurious partition, which must be maintained. (rEFIt can, however,
boot to it.)


  • Joe van Tunen
    Joe van Tunen

    The problem is not with rEFIt.

    When you select a legacy OS partition with rEFIt (Windows or Linux), the following occurs:
    1) rEFIt sets the active partition flag in the MBR of the disk containing the selected partition to the selected partition.
    2) rEFIt sets the NVRAM variable BootCampHD to the disk containing the selected partition (note that this occurs in the current source code version and not in the released version 0.14 - this adds support for multiple disks)
    3) rEFIt starts the legacy boot loader in EFI which loads BIOS
    4) The BIOS runs the code in the MBR which runs the code in the boot blocks of the active partition.
    5) If the active partition was Windows XP, then the NTLDR is started. If the active partition was kubuntu, then GRUB is started.

    Windows XP should be on the last partition (it doesn't need to be physically last, just last in the MBR). The first partition is the EFI partition. You can include Mac OS X in the MBR (if you want to view files on the Mac OS X partition while running the other OS's) or leave it out.

    The code in the boot blocks (or VBR) needs to be able to load files from the file system. For the Windows XP partition, the code supports NTFS in order to load NTLDR. For kubuntu, the code needs to support EXT4 to load GRUB.

    Let rEFIt select the partition to boot from. The default entry in boot.ini of Windows XP should point to the Windows XP partition. The default entry in the GRUB configuration file of kubuntu should point to kubuntu.

    You need to make sure the MBR code, the boot blocks code, and the config files are setup correctly.

    Before fixing boot blocks of a partition, it might be a good idea to make sure the active partition is set to that partition. rEFIt changes the active partition when you boot from a partition but if you're booting from an installation CD, the active partition might be set to some other partition than the partition you want to work on.

    On my disks, I have a Vista MBR which loads Vista VBR's on my Vista and XP partitions and a GRUB2 VBR on my Ubuntu partition.

  • Dick Hamlet
    Dick Hamlet

    Thanks to Joe van Tunen (joevt) for a courteous, prompt, convincing
    response. Sorry about submitting a bug report against the wrong
    software... I know very little about either PC or Mac hardware and
    booting (the last boot loader I wrote would have been for a Burroughs
    B5000, c. 1969!), and I'm now a bit wiser.

    The original post is correct in that the kubuntu 10.04 installation
    does not boot properly with Windows under rEFIt, while 9.04 does.
    But as Joe points out, there can be many
    reasons for this. Through all my fruitless experimentation with 10.04,
    rEFIt always found the correct number and partition location of all
    boot loaders; it just would not boot 10.04 as installed from the CD.
    I'd wrongly fastened on GRUB vs. GRUB2 as the difference; Joe scotched
    that, and I don't have enough information to suggest another reason.
    (But it probably has to do with the interaction between what a Windows
    install puts in the MBR and what the 10.04 install does to it. Either one
    alone seems to be OK.)