Grub won't boot Windows 7, but EFI will
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Grub won't boot Windows 7, but EFI will

    Hi!
    I have Fedora 24 installed alongside Windows 7.

    I am able to boot Fedora kernels just fine, but whenever I try to boot the Windows installation, nothing happens.
    The boot just gets stuck displaying a single underscore _ , and no other error messages.

    When I go into the grub2 command prompt, and try

    Code:
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    boot
    the same thing happens: the screen just freezes, becomes unresponsive and Windows doesn't boot.

    The strange thing is: if I choose Windows from my Bios startup options, it boots perfectly fine.


    System information:

    • System: Lenovo ThinkPad x230
    • Partition Type: gpt
    • Boot Type: UEFI
    • Secure Boot: OFF



    Output of efibootmgr:

    Code:
    ...
    Boot0018* Windows Boot Manager
    Boot0019* Windows Boot Manager
    Boot001A* Fedora
    Boot entry information for Windows:
    Code:
    $ efibootdump Boot0018
    Boot0018: * Windows Boot Manager HD(2,GPT,a299fff2-ba84-4596-b79e-8e13940485e2,0x40800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)
    Boot entry information for Windows:

    Code:
    $ efibootdump Boot0019
    Boot0019: * Windows Boot Manager HD(2,GPT,a299fff2-ba84-4596-b79e-8e13940485e2,0x40800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a.................
    As you see, I have two boot entries in the EFI boot manager, but they both work perfectly fine.

    Entry for windows in `/etc/grub2-efi.cfg`:

    Code:
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menu
    entry_id_option 'osprober-efi-D601-A70F' {
            insmod part_gpt
            insmod fat
            set root='hd0,gpt2'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  D601-A70F
            else
              search --no-floppy --fs-uuid --set=root D601-A70F
            fi
            chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    }
    ### END /etc/grub.d/30_os-prober ###

    As you can see, there is nothing really special going on. There isn't really a difference between GRUB and EFI, both seem to only want to load `/EFI/Microsoft/Boot/bootmgfw.efi`, but for some reason, GRUB gets stuck while EFI doesn't.

    Does anyone know how to fix Grub to start my Windows?

  2. #2
    Join Date
    Dec 2013
    Location
    United Kingdom
    Posts
    7,155
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)

    Re: Grub won't boot Windows 7, but EFI will


  3. #3
    Join Date
    Nov 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Grub won't boot Windows 7, but EFI will

    Quote Originally Posted by antikythera
    Wow, now that's just ridiculous. Is there a link to the bug report?

    Either way, thanks for the link, I will try that!

  4. #4
    Join Date
    Dec 2008
    Location
    Paris, FR
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Grub won't boot Windows 7, but EFI will

    You can also use something like refind to choose between grub and windows booter with a nice gui.

  5. #5
    Join Date
    Nov 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Grub won't boot Windows 7, but EFI will

    This bug has been fixed in Fedora 24 and Fedora 25. Update grub to the newest version (grub2-2.02-0.38.fc24 or grub2-2.02-0.37.fc25 respectively), to fix this.

  6. #6
    Join Date
    Mar 2012
    Location
    München, Deutschland
    Posts
    897
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Re: Grub won't boot Windows 7, but EFI will

    Quote Originally Posted by FatLobyte
    This bug has been fixed in Fedora 24 and Fedora 25. Update grub to the newest version (grub2-2.02-0.38.fc24 or grub2-2.02-0.37.fc25 respectively), to fix this.
    In other words, what you do say is the following: you can perfectly boot from the newest version (grub2-2.02-0.38.fc24 or grub2-2.02-0.37.fc25 respectively) with grub entry:

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menu
    entry_id_option 'osprober-efi-D601-A70F' {
    insmod part_gpt
    insmod fat
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 D601-A70F
    else
    search --no-floppy --fs-uuid --set=root D601-A70F
    fi
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    }
    ### END /etc/grub.d/30_os-prober ###
    Am I getting this correct?

    Thank you,
    _nobody_

  7. #7
    Join Date
    Nov 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Grub won't boot Windows 7, but EFI will

    Quote Originally Posted by nobody
    In other words, what you do say is the following: you can perfectly boot from the newest version (grub2-2.02-0.38.fc24 or grub2-2.02-0.37.fc25 respectively) with grub entry:

    Am I getting this correct?
    I believe the grub2 version has been updated in the mean time to grub2-2.02-0.38.fc25, on my system I can boot Windows 7 just fine.

  8. #8
    Join Date
    Mar 2012
    Location
    München, Deutschland
    Posts
    897
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Re: Grub won't boot Windows 7, but EFI will

    Quote Originally Posted by FatLobyte
    I believe the grub2 version has been updated in the mean time to grub2-2.02-0.38.fc25, on my system I can boot Windows 7 just fine.
    Let us not mix apples and oranges. vmlinuz executable is completely different file formal then .efi format. I would NOT go to details of this. Not necessary here.

    What do you say is, that you can boot from GRUB2 WIN menuentry in F25 GRUB2. In other words, that Fedora folks were able to fix the format, so they can convert UEFI bootable .efi format to be executable by GRUB2 (from GRUB2 menu)?

    This is an excellent info, if I understood it correctly!

    (actually, however crazy does this sound, I NEVER looked into WIN menuentry in GRUB2 grub.cfg, NEVER enough carefully [just glanced through it], my COMPLETE BAD! )

    Thank you,
    _nobody_

  9. #9
    Join Date
    Nov 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Grub won't boot Windows 7, but EFI will

    Quote Originally Posted by nobody
    What do you say is, that you can boot from GRUB2 WIN menuentry in F25 GRUB2. In other words, that Fedora folks were able to fix the format, so they can convert UEFI bootable .efi format to executable by GRUB2 (from GRUB2 menu)?
    Yes that. If you are interested in the gritty details, you can read this:
    https://bugzilla.redhat.com/show_bug.cgi?id=1347291

  10. #10
    Join Date
    Mar 2012
    Location
    München, Deutschland
    Posts
    897
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking Re: Grub won't boot Windows 7, but EFI will

    Thank you for that, FAT_byte... Was real pleasure to read Laszlo Ersek and his implementation (C) analysis (and to refresh my C skills a bit).

    Here are my thoughts... Posted there, since here (I understand) it is more or less futile.

    Anyway... To whom it may be of use!

    https://bugzilla.redhat.com/show_bug.cgi?id=1347291#c97

    niemand 2016-12-13 00:45:23 EST
    Hello Laszlo (Ersek),

    I inspected your thoughts in your comment #39:
    https://bugzilla.redhat.com/show_bug.cgi?id=1347291#c39

    And you are Hell of the coder and observer! :-)

    I have question to you, though... Here:

    Why this should be done as you did it, and fixed RHEL the way you did it (from your comment #39)???

    RHEL implementation:

    argument --> parameter role
    -------- --------- --------
    handle_image:data --> relocate_coff:orig ORIGINAL
    handle_image:buffer_aligned --> relocate_coff:data COPY

    So, in the SUSE patch, only the copy is passed to relocate_coff():

    argument --> parameter role
    --------------------------- ------------------ ----
    handle_image:buffer_aligned --> relocate_coff:data COPY

    What prevents you to change code in RHEL, to actually match SUSE code and to pass ONLY relocatable copy of boot-loader (seems much simpler and much less error prone)???

    What/why are real differences in these two implementations??? Why RHEL needs original and copy sections, and SUSE ONLY the copy to work from?
    _nobody_

Similar Threads

  1. grub rescue> Boot fails: Example commands to boot+fix Windows 10 + Linux dual boot
    By Jeff72 in forum Guides & Solutions (Not For Questions)
    Replies: 4
    Last Post: 17th December 2016, 03:34 PM
  2. Grub for Fedora 12 and Windows XP can't boot Windows
    By acompay in forum Installation, Upgrades and Live Media
    Replies: 6
    Last Post: 25th April 2010, 06:57 PM
  3. Replies: 7
    Last Post: 24th January 2009, 11:28 PM
  4. Replies: 0
    Last Post: 15th May 2008, 02:13 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •