How do I use GRUB2 to directly boot UEFI Win 11, 10 & Ubuntu 22.04?
I have a 1 TB SSD with three operating systems and a large data partition installed.
/dev/sda1 2048 206847 204800 100M EFI System
/dev/sda2 206848 239615 32768 16M Microsoft reserved
/dev/sda3 239616 314812415 314572800 150G Microsoft basic data (Win 11)
/dev/sda4 314812416 524527615 209715200 100G Microsoft basic data (Win 10)
/dev/sda5 629385216 1999124479 1369739264 653.1G Microsoft basic data (Data)
/dev/sda6 1999126528 2000406527 1280000 625M Windows recovery environment
/dev/sda7 524527616 629385215 104857600 50G Linux filesystem (Ubuntu 22.04)
Note: Partition table entries are not in disk order.
GRUB2 currently shows both Ubuntu and the Windows Boot Manager (on /dev/sda1).
I want to use GRUB2 and not the Windows Boot Manager (BCD Store) to boot into Windows 11 and 10. When I first boot, I have to cursor to the Windows Boot Manager, hit enter and then wait for the Boor Manager to load. The Windows Boot Manager appears to reset the “default” flag when I select Windows 10 and then shutdown the computer and when it reboots I have to cursor to the Windows Boot Manager again and hit Enter to load Windows 10. I’m hopping that GRUB2 will let me boot into the selected OS directly from it’s menu, similar to what GRUB has always done.
UUID of the EFI partition
sudo blkid /dev/sda1
/dev/sda1: UUID="7CC3-A53D" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID=
sudo blkid /dev/sda3
/dev/sda3: LABEL="Kamrui-2 SSD (WIN 11)" BLOCK_SIZE="512" UUID="AE62C85D6
sudo blkid /dev/sda4
/dev/sda4: LABEL="Kamrui-2 SSD WIN 10" BLOCK_SIZE="512" UUID="88C44EEBC
PARTUUID=
I added the following to the grub.cfg file
sudo -H gedit /etc/grub.
menuentry 'Windows BootMgr' {
search --fs-uuid --no-floppy --set=root 7CC3-A53D
chainloader (${root}
}
sudo update-grub
This worked and loaded the Windows Boot Manager but it takes me directly to the Windows Boot Manager file and ends up working just like I’d selected it originally. But it does allow me to boot into Windows 10, it just takes forever.
I added the UUID of the Windows 10 partition to the 40_custom file but when I select it I get “Error: file EFIMicrosoft/
sudo -H gedit /etc/grub.
menuentry 'Windows 10' {
search --fs-uuid --no-floppy --set=root 88C44EEBC44EDB58
chainloader (${root}
}
sudo update-grub
Do I need to install the “bootmgfu.efi” to the root of the Windows 11 & 10 partitions? I can’t find it.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Manfred Hampl
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#2 |
Thanks for getting back to me so quickly. If I did it right, your solution didn’t work. I pasted the entries into my grub.d/40_custom file and ran sudo update-grub. Thank you for correcting “bootmgfw.efi “. I’m 80 years old and sometimes have trouble reading the small screen error messages. The following is a copy my grub.d/40_custom file. When I select the new Windows 11 or 10 entries I get the “Error: file EFIMicrosoft/
sudo blkid /dev/sda1 = UUID="7CC3-A53D"
sudo blkid /dev/sda3 = UUID= UUID="AE62C85D6
sudo blkid /dev/sda4 = UUID="88C44EEBC
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Windows BootMgr' {
search --fs-uuid --no-floppy --set=root 7CC3-A53D
chainloader (${root}
}
menuentry 'Windows 11' {
search --fs-uuid --no-floppy --set=root AE62C85D62C82BC1
chainloader (${root}
}
menuentry 'Windows 10' {
search --fs-uuid --no-floppy --set=root 88C44EEBC44EDB58
chainloader (${root}
}
Revision history for this message
|
#3 |
Asif Khan are you still trying to help me with this issue?
Are you the Asif Khan from Linux Pathfinder?
Revision history for this message
|
#4 |
This question was expired because it remained in the 'Open' state without activity for the last 15 days.
Revision history for this message
|
#5 |
Asif Khan replied to my question two weeks ago. I tried what he said but it gave me the same result I got when I tried it on my own. I want to bypass the Windows 11 boot loader and just use Grub2 to load my operating systems, like I've done for years with Grub.
Revision history for this message
|
#6 |
The message from Asif Khan was just spam, copying some general advice related to grub from some foreign source, for the purpose of adding dubious web links.
If you are using UEFI, then you better use the boot device selection offered by UEFI.
For detailed diagnostics you might try running bootinfo (probably needs to be installed).
Revision history for this message
|
#7 |
Manfred Hampl,
You’ve helped me in the past -thank you. I’m sorry somebody would hijack this help forum -you folks sure don’t deserve that.
You’d think at 80 years old I’d be smart enough to know “If it isn't broke, don’t fix it”. Ubuntu is my default OS (at the top), that's the one I mostly use. When I cursor to the Windows boot loader I can boot both Windows 10 or 11. As you suggested, I installed “boot-info-script in 22.04”
sudo add-apt-repository -c universe
sudo apt install boot-info-script
sudo bootinfoscript /home/pete/
Attached is my RESULTS file. Can GRUB2 boot these three operating systems directly or under UEFI we forced to only use the Windows boot loader for Windows 10 & 11?
=======
=> Windows 7/8/2012 is installed in the MBR of /dev/sda.
sda1: _______
File system: vfat
Boot sector type: Windows 8/2012: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /efi/Boot/
sda2: _______
File system:
Boot sector type: -
Boot sector info:
sda3: _______
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /Windows/
sda4: _______
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /Windows/
sda5: _______
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda6: _______
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda7: _______
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.04.3 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab
=======
Drive: sda _______
Disk /dev/sda: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: TEAM TM8PS7001T
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sda1 1 2,000,409,263 2,000,409,263 ee GPT
GUID Partition Table detected.
Partition Attrs Start Sector End Sector # of Sectors System
/dev/sda1 B 2,048 206,847 204,800 EFI System partition
/dev/sda2 206,848 239,615 32,768 Microsoft Reserved Partition (Windows)
/dev/sda3 + 239,616 314,812,415 314,572,800 Data partition (Windows/Linux)
/dev/sda4 314,812,416 524,527,615 209,715,200 Data partition (Windows/Linux)
/dev/sda5 629,385,216 1,999,124,479 1,369,739,264 Data partition (Windows/Linux)
/dev/sda6 R 1,999,126,528 2,000,406,527 1,280,000 Windows Recovery Environment (Windows)
/dev/sda7 524,527,616 629,385,215 104,857,600 Data partition (Linux)
Attributes: R=Required, N=No Block IO, B=Legacy BIOS Bootable, +=More bits set
"blkid" output: _______
Device UUID TYPE LABEL
/dev/loop0 squashfs
/dev/loop1 squashfs
/dev/loop10 squashfs
/dev/loop11 squashfs
/dev/loop12 squashfs
/dev/loop13 squashfs
/dev/loop14 squashfs
/dev/loop15 squashfs
/dev/loop16 squashfs
/dev/loop2 squashfs
/dev/loop3 squashfs
/dev/loop4 squashfs
/dev/loop5 squashfs
/dev/loop6 squashfs
/dev/loop7 squashfs
/dev/loop8 squashfs
/dev/loop9 squashfs
/dev/sda1 7CC3-A53D vfat
/dev/sda2
/dev/sda3 AE62C85D62C82BC1 ntfs Kamrui-2 SSD Win 11
/dev/sda4 88C44EEBC44EDB58 ntfs Kamrui-2 SSD WIN 10
/dev/sda5 F4E66CF1E66CB590 ntfs Kamrui-2 SSD DATA
/dev/sda6 C060007F60007E82 ntfs
/dev/sda7 cf2ce86b-
=======
total 0
lrwxrwxrwx 1 root root 9 Nov 2 15:29 ata-TEAM_
lrwxrwxrwx 1 root root 10 Nov 2 15:29 ata-TEAM_
lrwxrwxrwx 1 root root 10 Nov 2 15:29 ata-TEAM_
lrwxrwxrwx 1 root root 10 Nov 2 15:29 ata-TEAM_
lrwxrwxrwx 1 root root 10 Nov 2 15:29 ata-TEAM_
lrwxrwxrwx 1 root root 10 Nov 2 15:29 ata-TEAM_
lrwxrwxrwx 1 root root 10 Nov 2 15:29 ata-TEAM_
lrwxrwxrwx 1 root root 10 Nov 2 15:29 ata-TEAM_
=======
Device Mount_Point Type Options
/dev/sda1 /boot/efi vfat (rw,relatime,
/dev/sda7 / ext4 (rw,relatime,
/dev/sda7 /var/snap/
=======
-------
search.fs_uuid cf2ce86b-
set prefix=
configfile $prefix/grub.cfg
-------
=======
-------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${initrdfail}" = 2 ]; then
set initrdfail=
elif [ "${initrdfail}" = 1 ]; then
set next_entry=
set prev_entry=
save_env prev_entry
if [ "${next_entry}" ]; then
set initrdfail=2
fi
fi
if [ "${next_entry}" ] ; then
set default=
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_
menuentry_
else
menuentry_
fi
export menuentry_id_option
if [ "${prev_
set saved_entry=
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_
save_env saved_entry
fi
}
function initrdfail {
if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
if [ -z "${initrdfail}" ]; then
set initrdfail=1
if [ -n "${boot_once}" ]; then
set prev_entry=
save_env prev_entry
fi
fi
save_env initrdfail
fi; fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd1,gpt7'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root cf2ce86b-
fi
font=
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_
set timeout_
set timeout=10
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 10 ; then
set timeout=0
fi
fi
### END /etc/grub.
### BEGIN /etc/grub.
set menu_color_
set menu_color_
set color_normal=
### END /etc/grub.
### BEGIN /etc/grub.
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}
if [ ${grub_platform} != pc ]; then
set linux_gfx_mode=keep
elif hwmatch ${prefix}
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt7'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root cf2ce86b-
fi
linux /boot/vmlinuz-
initrd /boot/initrd.
}
submenu 'Advanced options for Ubuntu' $menuentry_
menuentry 'Ubuntu, with Linux 6.2.0-36-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt7'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root cf2ce86b-
fi
echo 'Loading Linux 6.2.0-36-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
menuentry 'Ubuntu, with Linux 6.2.0-36-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt7'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root cf2ce86b-
fi
echo 'Loading Linux 6.2.0-36-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
menuentry 'Ubuntu, with Linux 6.2.0-35-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt7'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root cf2ce86b-
fi
echo 'Loading Linux 6.2.0-35-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
menuentry 'Ubuntu, with Linux 6.2.0-35-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd1,gpt7'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root cf2ce86b-
fi
echo 'Loading Linux 6.2.0-35-generic ...'
linux /boot/vmlinuz-
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.
}
}
### END /etc/grub.
### BEGIN /etc/grub.
### END /etc/grub.
### BEGIN /etc/grub.
### END /etc/grub.
### BEGIN /etc/grub.
### END /etc/grub.
### BEGIN /etc/grub.
menuentry 'Windows Boot Manager (on /dev/sdb1)' --class windows --class os $menuentry_
insmod part_gpt
insmod fat
set root='hd1,gpt1'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root 7CC3-A53D
fi
chainloader /EFI/Microsoft/
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
### END /etc/grub.
### BEGIN /etc/grub.
menuentry 'UEFI Firmware Settings' $menuentry_
fwsetup
}
### END /etc/grub.
### BEGIN /etc/grub.
### END /etc/grub.
### BEGIN /etc/grub.
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.
### BEGIN /etc/grub.
if [ -f ${config_
source ${config_
elif [ -z "${config_
source $prefix/custom.cfg
fi
### END /etc/grub.
-------
=======
-------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda7 during installation
UUID=cf2ce86b-
# /boot/efi was on /dev/sda1 during installation
UUID=7CC3-A53D /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
-------
=================== sda7: Location of files loaded by Grub: =======
GiB - GB File Fragment(s)
279.079589844 = 299.659427840 boot/grub/grub.cfg 1
275.002105713 = 295.281262592 boot/vmlinuz 1
276.900539398 = 297.319690240 boot/vmlinuz-
275.002105713 = 295.281262592 boot/vmlinuz-
276.900539398 = 297.319690240 boot/vmlinuz.old 2
291.421226501 = 312.911159296 boot/initrd.img 1
290.866535187 = 312.315564032 boot/initrd.
291.421226501 = 312.911159296 boot/initrd.
290.866535187 = 312.315564032 boot/initrd.img.old 1
=======
/dev/sda3: unknown GPT attributes
8000000000000000
Revision history for this message
|
#8 |
What I see from your output is:
chainloader (${root}
/efi/Microsoft/
“Error: file EFIMicrosoft/
I do not know whether that is just a typo error in this question document, of if that causes the boot process not working as desired.
Revision history for this message
|
#9 |
Manfred Hampl,
I couldn’t find that error in the RESULTS file I posted. As you can see from the posts above, that error appeared when I selected either of the new Windows 11 or 10 GRUB2 entries. I got the “Error: file EFIMicrosoft/
This entry worked and took me to the same boot manager that was already displayed.
menuentry 'Windows BootMgr' {
search --fs-uuid --no-floppy --set=root 7CC3-A53D
chainloader (${root}
}
If I use the menu entry this provides or the original boot menu entry, I can boot into Windows 11 or 10 just fine, it just takes forever.
When I pasted either of the following (or both) two entries into my “grub.d/40_custom” file and ran “sudo update-grub” and tried to use one of them to boot, that produced the error message your seeing “Error: file EFIMicrosoft/
menuentry 'Windows 11' {
search --fs-uuid --no-floppy --set=root AE62C85D62C82BC1
chainloader (${root}
}
menuentry 'Windows 10' {
search --fs-uuid --no-floppy --set=root 88C44EEBC44EDB58
chainloader (${root}
}
I want to be able to boot directly into Windows 11 or 10, bypassing the slower Windows UEFI boot manager. If this isn’t possible with the new UEFI GRUB2 then I’ll close out my request for help. In either case, thanks for trying to help me.
Revision history for this message
|
#10 |
Have you tried replacing .../EFI/
Revision history for this message
|
#11 |
Manfred Hampl,
I edited my 40_custom file to look like this and ran sudo update-grub:
40_custom file (from sudo -H gedit /etc/grub.
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Windows BootMgr' {
search --fs-uuid --no-floppy --set=root 7CC3-A53D
chainloader (${root}
}
menuentry 'Windows 11' {
search --fs-uuid --no-floppy --set=root AE62C85D62C82BC1
chainloader (${root}
}
menuentry 'Windows 10' {
search --fs-uuid --no-floppy --set=root 88C44EEBC44EDB58
chainloader (${root}
}
When I rebooted and tried to boot into the newly added Windows 11 menu item I got the essentially the same error message (“Error: file efi/Microsoft/
Revision history for this message
|
#12 |
Manfred Hampl,
For your information, when I selected the menu item added buy
menuentry 'Windows BootMgr' {
search --fs-uuid --no-floppy --set=root 7CC3-A53D
chainloader (${root}
}
I was able to use the windows boot manager to load Windows 11 & 10, so using lower case "efi" didn't change the way that worked.
Revision history for this message
|
#13 |
What you didn't show is the output that you receive when you run
sudo update-grub
please paste it here
Revision history for this message
|
#14 |
pete@Kamrui-2:~$ sudo update-grub
[sudo] password for pete:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/sda1@
Adding boot menu entry for UEFI Firmware Settings ...
done
pete@Kamrui-2:~$
Revision history for this message
|
#15 |
The update-grub output looks normal.
I am running out of ideas. I do not see anything wrong on Ubuntu or grub side. Your problem seems related to booting Windows, so maybe you better refer to support sites for WIndows.
Revision history for this message
|
#16 |
Manfred Hampl,
Thank you for trying to help me. I haven't been able to figure it out either. The SSD has separate partitions for the Windows Boot Manager (2), Windows 11, Windows 10, Ubuntu 22.04 and a Data partition. If I go thru the boot manager I can boot either of the Windows operating systems. GRUB2 gives me the choice of Ubuntu or the Windows Boot Manager -it defaults to Ubuntu, but I know how to change the default boot order. Theirs got to be something we're missing to configure GRUB2, but like you I haven't been able to figure it out. I'll follow your suggestion to try the support sites for Windows. Again, thanks for all your help.
Revision history for this message
|
#17 |
Thanks Manfred Hampl, that solved my question.