You are not logged in.

#1 2021-12-05 10:41:56

alba4k
Member
From: Switzerland
Registered: 2021-12-05
Posts: 52
Website

[SOLVED] How can I add Windows Boot Manager to grub?

How can I boot into Windows from grub? It got automatically found when I used manjaro
since it could help, here is the output of

sudo fdisk -l
Disk /dev/nvme0n1: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: WDC PC SN520 SDAPNUW-256G-1006          
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 82BBB9B1-1B1A-4018-AFBB-FC20F107548E

Dispositivo        Start      Fine   Settori   Size Tipo
/dev/nvme0n1p1      2048    534527    532480   260M EFI System
/dev/nvme0n1p2    534528    567295     32768    16M Microsoft reserved
/dev/nvme0n1p3    567296 498075647 497508352 237.2G Microsoft basic data
/dev/nvme0n1p4 498075648 500107263   2031616   992M Windows recovery environment


Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B96D645E-44E9-6B41-B568-AF56F083F528

Dispositivo     Start      Fine   Settori   Size Tipo
/dev/sda1        2048   1128447   1126400   550M EFI System
/dev/sda2     1128448 269563903 268435456   128G Linux filesystem
/dev/sda3   269563904 976771071 707207168 337.2G Microsoft basic data

as you can see, I have windows on /dev/nvme0n1p1 (bootloader), /dev/nvme0n1p1/dev/nvme0n1p3 (system) and Linux on /dev/sda1 (bootloader), /dev/sda2 (system)
I'm also planning on changing that, maybe with allocating a whole disk to Linux and a Whole disk and a half to Linux and half a disk to windows, maybe with a separate /home partition for linux, to be able to use the same for multiple distros and reinstalling systems in a faster way

In case you were wandering, this is the output of

sudo os-prober
/dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi

and of

sudo grub-kmconfig
Generating grub configuration file ...
#
# 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.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_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_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    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_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
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  b46decfc-a738-4af2-8c3f-c09b0d31b848
else
  search --no-floppy --fs-uuid --set=root b46decfc-a738-4af2-8c3f-c09b0d31b848
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=it_CH
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b46decfc-a738-4af2-8c3f-c09b0d31b848' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        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  b46decfc-a738-4af2-8c3f-c09b0d31b848
        else
          search --no-floppy --fs-uuid --set=root b46decfc-a738-4af2-8c3f-c09b0d31b848
        fi
        echo    'Loading Linux linux ...'
        linux   /boot/vmlinuz-linux root=UUID=b46decfc-a738-4af2-8c3f-c09b0d31b848 rw  loglevel=3 quiet
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-b46decfc-a738-4af2-8c3f-c09b0d31b848' {
        menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-b46decfc-a738-4af2-8c3f-c09b0d31b848' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                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  b46decfc-a738-4af2-8c3f-c09b0d31b848
                else
                  search --no-floppy --fs-uuid --set=root b46decfc-a738-4af2-8c3f-c09b0d31b848
                fi
                echo    'Loading Linux linux ...'
                linux   /boot/vmlinuz-linux root=UUID=b46decfc-a738-4af2-8c3f-c09b0d31b848 rw  loglevel=3 quiet
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initramfs-linux.img
        }
Found fallback initrd image(s) in /boot:  initramfs-linux-fallback.img
        menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-b46decfc-a738-4af2-8c3f-c09b0d31b848' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                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  b46decfc-a738-4af2-8c3f-c09b0d31b848
                else
                  search --no-floppy --fs-uuid --set=root b46decfc-a738-4af2-8c3f-c09b0d31b848
                fi
                echo    'Loading Linux linux ...'
                linux   /boot/vmlinuz-linux root=UUID=b46decfc-a738-4af2-8c3f-c09b0d31b848 rw  loglevel=3 quiet
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initramfs-linux-fallback.img
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
Adding boot menu entry for UEFI Firmware Settings ...
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
        fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# 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.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
done

Last edited by alba4k (2021-12-14 06:29:17)

Offline

#2 2021-12-05 10:59:16

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,900

Re: [SOLVED] How can I add Windows Boot Manager to grub?

Read the warning for the os_prober section/the output when running grub-mkconfig. You need to add GRUB_DISABLE_OS_PROBER=false to your /etc/default/grub before generating the config with grub-mkconfig.

Offline

#3 2021-12-05 11:10:20

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: [SOLVED] How can I add Windows Boot Manager to grub?

If you don't want to use os_prober you can add this stanza to the end of the file at /etc/grub.d/40_custom instead (replace $uuid with the actual UUID of the Windows EFI system partition, which appears to be /dev/nvme0n1p1):

menuentry 'Windows' {
   search --fs-uuid --set=root $uuid
   chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

Note that os_prober has been disabled by default because the GRUB developers consider it "potentially dangerous": https://git.savannah.gnu.org/cgit/grub. … c66f517666

Offline

#4 2021-12-05 13:30:13

alba4k
Member
From: Switzerland
Registered: 2021-12-05
Posts: 52
Website

Re: [SOLVED] How can I add Windows Boot Manager to grub?

So, I have tried both the solutions above, but non of them appear to work, sadly. Editing

sudo grub-mkconfig
Generating grub configuration file ...
#
# 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.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_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_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    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_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
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  b46decfc-a738-4af2-8c3f-c09b0d31b848
else
  search --no-floppy --fs-uuid --set=root b46decfc-a738-4af2-8c3f-c09b0d31b848
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=it_CH
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b46decfc-a738-4af2-8c3f-c09b0d31b848' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        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  b46decfc-a738-4af2-8c3f-c09b0d31b848
        else
          search --no-floppy --fs-uuid --set=root b46decfc-a738-4af2-8c3f-c09b0d31b848
        fi
        echo    'Loading Linux linux ...'
        linux   /boot/vmlinuz-linux root=UUID=b46decfc-a738-4af2-8c3f-c09b0d31b848 rw  loglevel=3 quiet
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-b46decfc-a738-4af2-8c3f-c09b0d31b848' {
        menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-b46decfc-a738-4af2-8c3f-c09b0d31b848' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                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  b46decfc-a738-4af2-8c3f-c09b0d31b848
                else
                  search --no-floppy --fs-uuid --set=root b46decfc-a738-4af2-8c3f-c09b0d31b848
                fi
                echo    'Loading Linux linux ...'
                linux   /boot/vmlinuz-linux root=UUID=b46decfc-a738-4af2-8c3f-c09b0d31b848 rw  loglevel=3 quiet
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initramfs-linux.img
        }
Found fallback initrd image(s) in /boot:  initramfs-linux-fallback.img
        menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-b46decfc-a738-4af2-8c3f-c09b0d31b848' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                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  b46decfc-a738-4af2-8c3f-c09b0d31b848
                else
                  search --no-floppy --fs-uuid --set=root b46decfc-a738-4af2-8c3f-c09b0d31b848
                fi
                echo    'Loading Linux linux ...'
                linux   /boot/vmlinuz-linux root=UUID=b46decfc-a738-4af2-8c3f-c09b0d31b848 rw  loglevel=3 quiet
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initramfs-linux-fallback.img
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
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/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi
menuentry 'Windows Boot Manager (on /dev/nvme0n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-4224-04AA' {
        insmod part_gpt
        insmod fat
        search --no-floppy --fs-uuid --set=root 4224-04AA
        chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
Adding boot menu entry for UEFI Firmware Settings ...
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
        fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# 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' {
   search --fs-uuid --set=root /dev/nvme0n1p1
   chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
done

I'm also posting here both the file that I've ben suggested to edit:
/etc/default/grub:

# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE=menu

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT=true

# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU=y
GRUB_DISABLE_OS_PROBER=false

/etc/grub.d/40_custom:

#!/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' {
   search --fs-uuid --set=root /dev/nvme0n1p1
   chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

In case you were wandering, this is what grub looks like for me

Last edited by alba4k (2021-12-05 13:36:55)

Offline

#5 2021-12-05 13:46:07

progandy
Member
Registered: 2012-05-17
Posts: 5,211

Re: [SOLVED] How can I add Windows Boot Manager to grub?

grub-mkconfig does include both menu entries, now you have to tell it to write it to the grub config file instead of printing it to the terminal:
https://wiki.archlinux.org/title/GRUB#G … ation_file


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2021-12-05 13:47:48

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: [SOLVED] How can I add Windows Boot Manager to grub?

Did you direct the output of grub-mkconfig to /boot/grub/grub.cfg?

If you did then please provide the actual command you used and also post the output of

# lsblk -f
# efibootmgr -uv

EDIT: ninja'd by progandy...

Last edited by Head_on_a_Stick (2021-12-05 13:48:23)

Offline

#7 2021-12-06 17:07:38

alba4k
Member
From: Switzerland
Registered: 2021-12-05
Posts: 52
Website

Re: [SOLVED] How can I add Windows Boot Manager to grub?

No, i did not update /boot/grub/grub.cfg, and doing so indeed fixed the problem

sudo grub-mkconfig -o /boot/grub/grub.cfg

Thanks everybody!
in grub, I now see

Arch Linux
Advanced options for Arch Linux
Windows Boot Manager (on /dev/nvme0n1p1)
UEFI Boot options
Windows
Windows

I managed to remove one of the "Windows" options by removing the added part in /etc/grub.d/40_custom, but the other one is still there
I dont necessarily need to remove it, I can live with it there, but it would be nice not to have it twice
also, if I try to boot into it, it says that there is no drive named /dev/nvme0n1p1, but that might also be due to a typo somewhere
I could select it from grub, press e to edit it and delete everything, but how would I save it, then?

Last edited by alba4k (2021-12-06 17:07:57)

Offline

#8 2021-12-06 17:16:11

alba4k
Member
From: Switzerland
Registered: 2021-12-05
Posts: 52
Website

Re: [SOLVED] How can I add Windows Boot Manager to grub?

No, i did not update /boot/grub/grub.cfg, and doing so indeed fixed the problem (

sudo grub-mkconfig -o /boot/grub/grub.cfg

), Thanks everybody!
in grub, I now see

Arch Linux
Advanced options for Arch Linux
Windows Boot Manager (on /dev/nvme0n1p1)
UEFI Boot options
Windows
Windows

I managed to remove one of the "Windows" options by removing the added part in /etc/grub.d/40_custom, but the other one is still there
I dont necessarily need to remove it, I can live with it there, but it would be nice not to have it twice
also, if I try to boot into it, it says that there is no drive named /dev/nvme0n1p1, but that might also be due to a typo somewhere
I could select it from grub, press e to edit it and delete everything, but how would I save it, then?


Also, since Head_on_a_stick asked, there you go

sudo lsblk -f
NAME        FSTYPE FSVER LABEL            UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                           
├─sda1      vfat   FAT32                  25E3-EB55                                           
├─sda2      ext4   1.0                    b46decfc-a738-4af2-8c3f-c09b0d31b848   95.8G    18% /
└─sda3      ntfs         Storage          62E463EDE463C241                                    
nvme0n1                                                                                       
├─nvme0n1p1 vfat   FAT32 SYSTEM           4224-04AA                                           
├─nvme0n1p2                                                                                   
├─nvme0n1p3 ntfs         System           B8E4EF37E4EEF692                                    
└─nvme0n1p4 ntfs         Windows RE Tools 928283FC8283E359

and also

sudo efibootmgr -uv
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0005,0001,0006,0007,0003,0004,0002
Boot0000* grub_uefi     HD(1,GPT,3c5c541b-6770-bd45-92b8-2167c847db31,0x800,0x113000)/File(\EFI\grub_uefi\grubx64.efi)
Boot0001* Windows Boot Manager  HD(1,GPT,0d53e022-342b-48c3-ad87-8978e02ca33a,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)䥗䑎坏S
Boot0002* WDC PC SN520 SDAPNUW-256G-1006-192899801574   PciRoot(0x0)/Pci(0x1d,0x4)/Pci(0x0,0x0)/NVMe(0x1,00-1B-44-8B-44-0E-71-7B)걎脈鼑䵙຅᫢ⱒ뉙
Boot0003* IPV4 Network  PciRoot(0x0)/Pci(0x14,0x0)/USB(5,0)/USB(3,0)/MAC(64c901c82bc6,0)/IPv4(0.0.0.00.0.0.0,0,0)걎脈鼑䵙຅᫢ⱒ뉙
Boot0004* IPV6 Network  PciRoot(0x0)/Pci(0x14,0x0)/USB(5,0)/USB(3,0)/MAC(64c901c82bc6,0)/IPv6([::]:<->[::]:,0,0)걎脈鼑䵙຅᫢ⱒ뉙
Boot0005  USB:          PciRoot(0x0)/Pci(0x14,0x0)걎脈鼑䵙຅᫢ⱒ뉙耋
Boot0006* IPV4 Network - Realtek PCIe GBE Family Controller     PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/MAC(f8b46aa8c23b,0)/IPv4(0.0.0.00.0.0.0,0,0)걎脈鼑䵙຅᫢ⱒ뉙
Boot0007* IPV6 Network - Realtek PCIe GBE Family Controller     PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/MAC(f8b46aa8c23b,0)/IPv6([::]:<->[::]:,0,0)걎脈鼑䵙຅᫢ⱒ뉙

Offline

#9 2021-12-06 18:02:05

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Re: [SOLVED] How can I add Windows Boot Manager to grub?

alba4k wrote:

I managed to remove one of the "Windows" options by removing the added part in /etc/grub.d/40_custom, but the other one is still there

Is there a file at /boot/grub/custom.cfg? That is sourced from grub.cfg so it might be causing the added entry.

alba4k wrote:

if I try to boot into it, it says that there is no drive named /dev/nvme0n1p1

GRUB doesn't understand "/dev/nvme0n1p1". The actual UUID of the ESP should be used instead, as I mentioned earlier.

alba4k wrote:

I could select it from grub, press e to edit it and delete everything, but how would I save it, then?

Edits from the GRUB screen are not persistent.

Offline

#10 2021-12-06 20:08:22

alba4k
Member
From: Switzerland
Registered: 2021-12-05
Posts: 52
Website

Re: [SOLVED] How can I add Windows Boot Manager to grub?

Is there a file at /boot/grub/custom.cfg? That is sourced from grub.cfg so it might be causing the added entry.

alba4k@ArchLinux ~> ls -a /boot/grub/
.  ..  fonts  grub.cfg  grubenv  locale  themes  x86_64-efi

As you can see, it does not look like there is, I think I will just live with it (not a big deal tho, if we consider that I probably won't spend hours staring at that extra entry)

Offline

Board footer

Powered by FluxBB