You are not logged in.

#76 2013-10-07 13:01:53

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

So I've replaced the bootmgfw.efi (Windows bootloader) with the refind_x64.efi bootloader. I've moved the Windows bootloader and associated files into /boot/efi/EFI/Windows. rEFInd boots up first now and I just had to manually add a Windows entry in the refind.conf file. Here is the complete list of files/directories on the EFI partition:

/boot/efi/EFI:
Boot
Microsoft
tools
Windows

/boot/efi/EFI/Boot:
bootx64.efi

/boot/efi/EFI/Microsoft:
Boot

/boot/efi/EFI/Microsoft/Boot:
banner.png
bootmgfw.efi
drivers_x64
icons
keys
refind.conf

/boot/efi/EFI/Tools:

/boot/efi/EFI/Windows:
Boot

/boot/efi/EFI/Windows/boot:
BCD
BCD.LOG
BCD.LOG1
BCD.LOG2
bg-BG
bootmgfw.efi
bootmgr.efi
BOOTSTAT.DAT
boot.stl
cs-CZ
da-DK
de-DE
el-GR
en-GB
en-US
es-ES
et-EE
fi-FI
Fonts
fr-FR
hr-HR
hu-HU
it-IT
ja-JP
ko-KR
lt-LT
lv-LV
memtest.efi
nb-NO
nl-NL
pl-PL
pt-BR
pt-PT
qps-ploc
Resources
ro-RO
ru-RU
sk-SK
sl-SI
sr-Latn-CS
sv-SE
tr-TR
uk-UA
zh-CN
zh-HK
zh-TW

Last edited by DoctorSelar (2013-10-07 13:03:19)


Never assume. It makes an "ass" of "u" and "me".

Offline

#77 2013-10-07 13:46:29

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: Setting GRUB as the default boot manager on a UEFI-based system

DoctorSelar wrote:

So I've replaced the bootmgfw.efi (Windows bootloader) with the refind_x64.efi bootloader. I've moved the Windows bootloader and associated files into /boot/efi/EFI/Windows. rEFInd boots up first now and I just had to manually add a Windows entry in the refind.conf file. Here is the complete list of files/directories on the EFI partition:

/boot/efi/EFI:
Boot
Microsoft
tools
Windows

/boot/efi/EFI/Boot:
bootx64.efi

/boot/efi/EFI/Microsoft:
Boot

/boot/efi/EFI/Microsoft/Boot:
banner.png
bootmgfw.efi
drivers_x64
icons
keys
refind.conf

/boot/efi/EFI/Tools:

/boot/efi/EFI/Windows:
Boot

/boot/efi/EFI/Windows/boot:
BCD
BCD.LOG
BCD.LOG1
BCD.LOG2
bg-BG
bootmgfw.efi
bootmgr.efi
BOOTSTAT.DAT
boot.stl
cs-CZ
da-DK
de-DE
el-GR
en-GB
en-US
es-ES
et-EE
fi-FI
Fonts
fr-FR
hr-HR
hu-HU
it-IT
ja-JP
ko-KR
lt-LT
lv-LV
memtest.efi
nb-NO
nl-NL
pl-PL
pt-BR
pt-PT
qps-ploc
Resources
ro-RO
ru-RU
sk-SK
sl-SI
sr-Latn-CS
sv-SE
tr-TR
uk-UA
zh-CN
zh-HK
zh-TW

Are you able to successfully boot into Windows? AFAIK the BCD file (Windows equivalent of grub.cfg or syslinux.cfg) should be located at /EFI/Microsoft/Boot/BCD . However you have moved the entire /EFI/Microsoft/Boot/ to /EFI/Windows/Boot/ . Even if you manually start /EFI/Windows/Boot/bootmgfw.efi via rEFInd, bootmgfw.efi should later complain that it is unable to read "Boot Configuration Data" (BCD). I suggest moving back /EFI/Windows/Boot/ contents to /EFI/Microsoft/Boot/ and renaming the original bootmgfw.efi alone to something else.

Offline

#78 2013-10-07 16:08:55

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Setting GRUB as the default boot manager on a UEFI-based system

the.ridikulus.rat wrote:

Are you able to successfully boot into Windows? AFAIK the BCD file (Windows equivalent of grub.cfg or syslinux.cfg) should be located at /EFI/Microsoft/Boot/BCD . However you have moved the entire /EFI/Microsoft/Boot/ to /EFI/Windows/Boot/ . Even if you manually start /EFI/Windows/Boot/bootmgfw.efi via rEFInd, bootmgfw.efi should later complain that it is unable to read "Boot Configuration Data" (BCD). I suggest moving back /EFI/Windows/Boot/ contents to /EFI/Microsoft/Boot/ and renaming the original bootmgfw.efi alone to something else.

I concur. (Of course, if rEFInd can boot Windows, then both the.ridikulus.rat and I are mistaken about how the Windows boot loader works, and you can ignore this advice.) I'll also point out that if you move bootmgfw.efi to almost any subdirectory of the "EFI" directory on the ESP (say, if it becomes EFI/Microsoft/bootmgfw.efi), rEFInd will auto-detect it. If it's named EFI/Microsoft/bootmgfw.efi, rEFInd should even give it a Windows icon.

Offline

#79 2013-10-07 17:24:39

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

To the.ridikulus.rat: Windows boots fine through my current setup - no errors are shown on rEFInd.
To srs5694: rEFInd did not detect bootmgfw.efi in /boot/efi/EFI/Windows/Boot. I had to manually add it into /boot/efi/EFI/Microsoft/Boot/refind.conf using the Windows entry that was commented out with a few tweaks.


Never assume. It makes an "ass" of "u" and "me".

Offline

#80 2013-10-07 20:19:39

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Setting GRUB as the default boot manager on a UEFI-based system

DoctorSelar wrote:

rEFInd did not detect bootmgfw.efi in /boot/efi/EFI/Windows/Boot. I had to manually add it into /boot/efi/EFI/Microsoft/Boot/refind.conf using the Windows entry that was commented out with a few tweaks.

rEFInd scans subdirectories of the "EFI" directory (such as EFI/Microsoft, EFI/Windows, and EFI/arch), but it stops there -- it doesn't do a recursive search, so it won't auto-detect files in EFI/Microsoft/Fred, EFI/Windows/Boot, EFI/arch/gummiboot, or whatever. There is one exception to this rule: EFI/Microsoft/Boot/bootmgfw.efi. rEFInd will detect that boot loader by default. Thus, what you describe is to be expected. It's also not what I specified: I said to put the file in EFI/Microsoft (or EFI/Windows or most other EFI/* directories), not in EFI/Windows/Boot.

Offline

#81 2015-10-10 16:51:37

gravious
Member
Registered: 2015-10-10
Posts: 1

Re: Setting GRUB as the default boot manager on a UEFI-based system

The default boot manager can be set to GRUB on a UEFI-based system by replacing the default file \EFI\BOOT\BOOT{machine type short-name}.EFI on the UEFI partition, if the UEFI firmware software stack is in accordance with the UEFI specification.

After a new installation of Windows 10 the Windows boot manager file on x64 machines can be found on the UEFI partition at \EFI\Boot\bootx64.efi, which is equal to \EFI\Microsoft\Boot\bootmgfw.efi.

Paragraph 3.5.1.1 of the Unified Extensible Firmware Interface Specification, Version 2.5. April, 2015 (http://uefi.org/specifications) states:

...then the system firmware will attempt to boot from a removable media FilePathList[0] by adding a default file name in the form \EFI\BOOT\BOOT{machine type short-name}.EFI. Where machine type short-name defines a PE32+ image format architecture. Each file only contains one UEFI image type, and a system may support booting from one or more images types. Table 12 lists the UEFI image types.

Table 12. UEFI Image Types
----------------------------------------------------------------------------------------------------------------------
                                      File Name Convention     PE Executable Machine Type
----------------------------------------------------------------------------------------------------------------------
32-bit                              BOOTIA32.EFI              0x14c
x64                                 BOOTx64.EFI              0x8664
Itanium architecture          BOOTIA64.EFI               0x200
AArch32 architecture        BOOTARM.EFI              0x01c2
AArch64 architecture        BOOTAA64.EFI          0xAA64
----------------------------------------------------------------------------------------------------------------------

However...

My Intel NUC detects the UEFI partition created by Windows 10 and loads the file \EFI\Microsoft\Boot\bootmgfw.efi instead of using the default/standardized path \EFI\Boot\bootx64.efi.

Replacing \EFI\Microsoft\Boot\bootmgfw.efi with \EFI\grub\grubx64.efi does boot into GRUB.

-----------------------------------------------------------------

Grub config example:

# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod ext2

menuentry "Windows 10" {
        insmod part_gpt
        insmod fat
        insmod search_fs_uuid
        insmod chain

        # Set root to UUID of the UEFI partition
        search --fs-uuid --no-floppy --set=root DCB9-C783

        # Path to the real Windows boot loader
        chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi  or (${root})/EFI/Boot/bootx64.efi
}

menuentry "GNU/Linux, Linux 4.2.3 LFS-7.6-systemd" {
        linux   /boot/vmlinuz-4.2.3 root=/dev/sda7
        set root=(hd0,7)
}

-----------------------------------------------------------------

Linux partitions can be accessed on Windows with Ext2fsd (an ext2/3/4 Windows volume manager): http://sourceforge.net/projects/ext2fsd

-----------------------------------------------------------------

The Windows Boot Configuration Data store can be found in the folder \Windows\Boot on the drive Windows was installed.

Boot Configuration Data (BCD) is a firmware-independent database for boot-time configuration data. It is used by Microsoft's new Windows Boot Manager and replaces the boot.ini that was used by NTLDR.

There is no need to change the BCD store, but a backup of the BCD store can be made with bcdedit /export [filename].

See also:

    Windows Vista startup process - Boot Configuration Data
    https://en.wikipedia.org/wiki/Windows_V … ation_Data

    How the Boot Configuration Data Store Works
    https://technet.microsoft.com/en-us/lib … s.10).aspx

    Installing Windows to an EFI-Based Computer
    https://technet.microsoft.com/en-us/lib … 2147217396

Last edited by gravious (2015-10-10 19:29:57)

Offline

#82 2015-10-11 10:53:48

kalsan
Member
Registered: 2011-10-10
Posts: 119

Re: Setting GRUB as the default boot manager on a UEFI-based system

On HP laptops with professional BIOS (e.g. EliteBooks), you can set a custom boot option to \EFI\grub\grubx64.efi and then change the boot order such that custom comes above OS Boot Manager.
I consider this a more elegant solution, but it's not possible on many consumer laptops.

Offline

Board footer

Powered by FluxBB