Boot grub2 stage2 directly from windows bootmgr with grub4dos stage1

There is problem which has been puzzled me for long time. When the grub2 root is on 2nd disk, the stage2 is not directly bootable from grub4dos stage1, but can be chain loaded from grub4dos as a linux kernel. The same problem happens to burg as well.

It turns out the stage2 file only has the relative path from root if you use grub-install script. So all you have to do is to embed a absolute path in prefix. Here is the brief step to make a direct bootable stage2.

grub-mkimage --output=/boot/grub/core.img --prefix=(hd1,2)/boot/grub 
         biosdisk part_msdos ext2
cat /boot/grub/lnxboot.img /boot/grub/core.img > g2ldr

Now copy g2ldr to your windows’ partition. Make a grub4dos stage1 file

grubinst.exe -o -b=g2ldr g2ldr.mbr

You can find grubinst.exe from grub4dos website.

Add it to windows bootmgr with bcdedit

bcdedit /create /d Linux /application BOOTSECTOR
bcdedit /set {ID} device partition=c:
bcdedit /set {ID}  path g2ldr.mbr
bcdedit /displayorder {ID} /addlast
  • Pingback: GRUB config on another disk - Page 2()

  • 민준 김

    grub-mkimage –output=/boot/grub/core.img –prefix=(hd1,2)/boot/grub biosdisk part_msdos ext2
    If I command grub-mkimage, the result is
    bash: syntax error near unexpected token `(‘
    Can you help me?
    Thanks.

    • Helper

      Try grub-mkimage –output=/boot/grub/core.img –prefix=(hd1,2)/boot/grub biosdisk part_msdos ext2

  • Thank you, helper.
    But that command also have error.
    If I command –output=/boot/grub/core.img –prefix=(hd0,7)/boot/grub biosdisk part_msdos ext2
    The result is
    Target format not specified (use the -O option).

    Thanks.

    I think add ‘-O i386-pc’ is good. What is target format of that command?

  • Pingback: Ecoute le viel homme délirer » dualboot vista-linux sur un deuxième disque()