Bug 15497

Summary: Grub can't boot already installed windows 8 in UEFI machine.
Product: Mageia Reporter: Fryderyk Mazurek <dedykjp>
Component: InstallerAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: Normal    
Version: Cauldron   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: CVE:
Status comment:

Description Fryderyk Mazurek 2015-03-15 15:50:09 CET
I have a problem with my already installed windows 8 in UEFI machine. The problem exists in my real machine and virtualbox.

After do a fresh mageia 5 network install, I get the GRUB menu with position "Windows Boot Manager". Choose this menu ends with error:

----
error: file '/EFI/Microsoft/Boot/bootmgfw.efi' not found.
error: you need to load the kernel first

Please any key to continue...
----

I did a investigation and I know that the problem is with generated /boot/grub2/grub.cfg config file. Generated body of menu entry is not enough to boot windows 8.

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager' {
          chainloader /EFI/Microsoft/Boot/bootmgfw.efi
          boot
}
### END /etc/grub.d/30_os-prober ###

When I manually change this section to:

menuentry "Windows Boot Manager" {
    insmod part_gpt
    insmod fat
    insmod search_fs_uuid
    insmod chain
    search --fs-uuid --no-floppy --set=root EFI_UUID
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

where EFI_UUID is the output of command: "grub2-probe --target=fs_uuid /boot/EFI/EFI/Microsoft/Boot/bootmgfw.efi" (in my machine is 7E9C-64E6) then I can boot to windows 8 without any problem.

Because grub.cfg file is generated and can be overwrite in any time, my workaround is add this section to file /etc/grub.d/40_custom file.

I think that the problem is with command grub2-mkconfig which run /etc/grub.d/30_os-prober script. The output of this script ends with some error, but I don't know reason of this error.

[root@localhost ~]# /etc/grub.d/30_os-prober
/usr/sbin/grub2-probe: error: cannot find a GRUB drive for Microsoft/Boot/bootmgfw.efi.  Check your device.map.
Found Windows Boot Manager on Microsoft/Boot/bootmgfw.efi
menuentry 'Windows Boot Manager' {
          chainloader /EFI/Microsoft/Boot/bootmgfw.efi
          boot
}

I think this problem is quite important and should be fixed without do any workaround. Generated grub.cfg file should be valid to boot windows 8 after install mageia.

PS. One additional info. In VirtualBox UEFI system is the bug which cause that after shutdown machine or boot to windows 8, EFI boot manager forget the config and automatically boot to windows 8. My workaround is enter to EFI menu by press ESC, choose "Boot Manager", next "EFI Internal Shell" to get EFI shell. Later I do:

2.0 Shell> fs0:
2.0 FS0:\> cd \EFI\mageia
2.0 FS0:\EFI\mageia\> bcfg boot add 0 grubx64.efi mageia
Target = 0003
bcfg: Add Boot0003 as 0
2.0 FS0:\EFI\mageia\> exit

and later "Continue" to get Grub 2 Menu.


Reproducible: 

Steps to Reproduce:
Comment 1 Fryderyk Mazurek 2015-03-18 08:16:58 CET
Very similar to https://bugs.mageia.org/show_bug.cgi?id=15507 .

My bug was first, but in #15507 bug is processing to find a solution.

*** This bug has been marked as a duplicate of bug 15507 ***

Status: NEW => RESOLVED
Resolution: (none) => DUPLICATE