Add Windows to GRUB

Good afternoon folks!

I’m quite new to EOS & Arch generally, but have been using Debian-based & OpenSuse distros for more than a decade.

I am used to dual-boot with Windows (sue me, I sometimes need some tools they only provide there), but I can’t find the W boot entry in GRUB.
I’ve been browsing the forums for some times, yet, I haven’t managed to solve my problem.

Can some wizards help me out?

Here are some info:

test -d /sys/firmware/efi && echo UEFI || echo BIOS` 
UEFI
sudo parted -l
[sudo] Mot de passe de math : 
Modèle : ATA ST1000LM035-1RK1 (scsi)
Disque /dev/sda : 1000GB
Taille des secteurs (logiques/physiques) : 512B/4096B
Table de partitions : gpt
Drapeaux de disque : 

Numéro  Début   Fin     Taille  Système de fichiers  Nom                   Drapeaux
 1      1049kB  1000GB  1000GB  ntfs                 Basic data partition  msftdata


Modèle : WDC PC SN520 SDAPNUW-128G-1006 (nvme)
Disque /dev/nvme0n1 : 128GB
Taille des secteurs (logiques/physiques) : 512B/512B
Table de partitions : gpt
Drapeaux de disque : 

Numéro  Début   Fin     Taille  Système de fichiers  Nom                           Drapeaux
 1      1049kB  17,8MB  16,8MB                       Microsoft reserved partition  msftres, no_automount
 2      17,8MB  63,0GB  63,0GB  ntfs                 Basic data partition          msftdata
 4      63,3GB  68,5GB  5121MB  linux-swap(v1)                                     swap
 3      68,5GB  109GB   40,9GB  ext4
 5      109GB   111GB   2097MB  fat32                                              démarrage, esp
 6      111GB   128GB   16,6GB  ext4
efibootmgr -v
BootCurrent: 0009
Timeout: 2 seconds
BootOrder: 0006,0008,0005,0002,0000,0003,0001,0004,0009,9999
Boot0000* opensuse-secureboot   HD(1,GPT,dfc98513-1cd7-4b9d-bb7a-80d4f23388c3,0x7564800,0x96000)/\EFI\opensuse\shim.efi
      dp: 04 01 2a 00 01 00 00 00 00 48 56 07 00 00 00 00 00 60 09 00 00 00 00 00 13 85 c9 df d7 1c 9d 4b bb 7a 80 d4 f2 33 88 c3 02 02 / 04 04 32 00 5c 00 45 00 46 00 49 00 5c 00 6f 00 70 00 65 00 6e 00 73 00 75 00 73 00 65 00 5c 00 73 00 68 00 69 00 6d 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0001* ubuntu        HD(1,GPT,dfc98513-1cd7-4b9d-bb7a-80d4f23388c3,0x7564800,0x96000)/\EFI\ubuntu\shimx64.efi
      dp: 04 01 2a 00 01 00 00 00 00 48 56 07 00 00 00 00 00 60 09 00 00 00 00 00 13 85 c9 df d7 1c 9d 4b bb 7a 80 d4 f2 33 88 c3 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 75 00 62 00 75 00 6e 00 74 00 75 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0002* Windows Boot Manager  HD(3,GPT,dfc98513-1cd7-4b9d-bb7a-80d4f23388c3,0x7564800,0x96000)/\EFI\Microsoft\Boot\bootmgfw.efi57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000061000100000010000000040000007fff0400
      dp: 04 01 2a 00 03 00 00 00 00 48 56 07 00 00 00 00 00 60 09 00 00 00 00 00 13 85 c9 df d7 1c 9d 4b bb 7a 80 d4 f2 33 88 c3 02 02 / 04 04 46 00 5c 00 45 00 46 00 49 00 5c 00 4d 00 69 00 63 00 72 00 6f 00 73 00 6f 00 66 00 74 00 5c 00 42 00 6f 00 6f 00 74 00 5c 00 62 00 6f 00 6f 00 74 00 6d 00 67 00 66 00 77 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
    data: 57 49 4e 44 4f 57 53 00 01 00 00 00 88 00 00 00 78 00 00 00 42 00 43 00 44 00 4f 00 42 00 4a 00 45 00 43 00 54 00 3d 00 7b 00 39 00 64 00 65 00 61 00 38 00 36 00 32 00 63 00 2d 00 35 00 63 00 64 00 64 00 2d 00 34 00 65 00 37 00 30 00 2d 00 61 00 63 00 63 00 31 00 2d 00 66 00 33 00 32 00 62 00 33 00 34 00 34 00 64 00 34 00 37 00 39 00 35 00 7d 00 00 00 61 00 01 00 00 00 10 00 00 00 04 00 00 00 7f ff 04 00
Boot0003* MX Linux      HD(1,GPT,dfc98513-1cd7-4b9d-bb7a-80d4f23388c3,0x7564800,0x96000)/\EFI\MX\grubx64.efi
      dp: 04 01 2a 00 01 00 00 00 00 48 56 07 00 00 00 00 00 60 09 00 00 00 00 00 13 85 c9 df d7 1c 9d 4b bb 7a 80 d4 f2 33 88 c3 02 02 / 04 04 2c 00 5c 00 45 00 46 00 49 00 5c 00 4d 00 58 00 5c 00 67 00 72 00 75 00 62 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0004* Manjaro       HD(4,GPT,366cc20b-5d29-e040-8d04-4bf74ca8778b,0xed85800,0xf3800)/\EFI\Manjaro\grubx64.efi
      dp: 04 01 2a 00 04 00 00 00 00 58 d8 0e 00 00 00 00 00 38 0f 00 00 00 00 00 0b c2 6c 36 29 5d 40 e0 8d 04 4b f7 4c a8 77 8b 02 02 / 04 04 36 00 5c 00 45 00 46 00 49 00 5c 00 4d 00 61 00 6e 00 6a 00 61 00 72 00 6f 00 5c 00 67 00 72 00 75 00 62 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0005* Debian        HD(3,GPT,dfc98513-1cd7-4b9d-bb7a-80d4f23388c3,0x7564800,0x96000)/\EFI\Debian\shimx64.efi
      dp: 04 01 2a 00 03 00 00 00 00 48 56 07 00 00 00 00 00 60 09 00 00 00 00 00 13 85 c9 df d7 1c 9d 4b bb 7a 80 d4 f2 33 88 c3 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 44 00 65 00 62 00 69 00 61 00 6e 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0006* arch  HD(5,GPT,58804c5e-e93c-4fc2-a37c-05b5638e0cfa,0xcb9e000,0x3e8000)/\EFI\arch\grubx64.efi
      dp: 04 01 2a 00 05 00 00 00 00 e0 b9 0c 00 00 00 00 00 80 3e 00 00 00 00 00 5e 4c 80 58 3c e9 c2 4f a3 7c 05 b5 63 8e 0c fa 02 02 / 04 04 30 00 5c 00 45 00 46 00 49 00 5c 00 61 00 72 00 63 00 68 00 5c 00 67 00 72 00 75 00 62 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0008* Linux Boot Manager    HD(5,GPT,58804c5e-e93c-4fc2-a37c-05b5638e0cfa,0xcb9e000,0x3e8000)/\EFI\systemd\systemd-bootx64.efi
      dp: 04 01 2a 00 05 00 00 00 00 e0 b9 0c 00 00 00 00 00 80 3e 00 00 00 00 00 5e 4c 80 58 3c e9 c2 4f a3 7c 05 b5 63 8e 0c fa 02 02 / 04 04 46 00 5c 00 45 00 46 00 49 00 5c 00 73 00 79 00 73 00 74 00 65 00 6d 00 64 00 5c 00 73 00 79 00 73 00 74 00 65 00 6d 00 64 00 2d 00 62 00 6f 00 6f 00 74 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0009* Internal Hard Disk    PciRoot(0x0)/Pci(0x1,0x2)/Pci(0x0,0x0)/NVMe(0x1,00-1B-44-4A-44-E4-71-E5)/HD(5,GPT,58804c5e-e93c-4fc2-a37c-05b5638e0cfa,0xcb9e000,0x3e8000)0000424f
      dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 02 01 / 01 01 06 00 00 00 / 03 17 10 00 01 00 00 00 00 1b 44 4a 44 e4 71 e5 / 04 01 2a 00 05 00 00 00 00 e0 b9 0c 00 00 00 00 00 80 3e 00 00 00 00 00 5e 4c 80 58 3c e9 c2 4f a3 7c 05 b5 63 8e 0c fa 02 02 / 7f ff 04 00
    data: 00 00 42 4f
Boot9999* USB Drive (UEFI)      PciRoot(0x0)/Pci(0x1d,0x0)/USB(16,0)0000424f
      dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 1d / 03 05 06 00 10 00 / 7f ff 04 00
    data: 00 00 42 4f

→ maybe can you also help me clean the million distro list previously installed? :slight_smile:


cat /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 `videoinfo'
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="false"

# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU="y"

# Probing for other operating systems is disabled for security reasons. Read
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
# functionality install os-prober and uncomment to detect and include other
# operating systems.
# GRUB_DISABLE_OS_PROBER="false"

#GRUB_DISABLE_LINUX_RECOVERY="true"
sudo grub-mkconfig
[sudo] Mot de passe de math : 
Création du fichier de configuration GRUB…
#
# 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
search --no-floppy --fs-uuid --set=root 857bf8cf-d32c-45f3-8b28-bd4d9b499548
    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=fr_FR
  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/06_grub-customizer_menu_color_helper ###
### END /etc/grub.d/06_grub-customizer_menu_color_helper ###

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

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

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

### BEGIN /etc/grub.d/25_bli ###
if [ "$grub_platform" = "efi" ]; then
  insmod bli
fi
### END /etc/grub.d/25_bli ###

### BEGIN /etc/grub.d/30_os-prober ###
Attention : le sondeur de systèmes d'exploitation ne sera pas exécuté pour détecter d'autres partitions amorçables.
Les systèmes qu'elles contiennent ne seront pas ajoutés à la configuration de démarrage de GRUB.
Consultez la documentation relative à GRUB_DISABLE_OS_PROBER.
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
Ajout de l'entrée du menu d'amorçage pour les paramètres du firmware UEFI …
if [ "$grub_platform" = "efi" ]; then
        fwsetup --is-supported
        if [ "$?" = 0 ]; then
                menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
                        fwsetup
                }
        fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/35_fwupd ###
### END /etc/grub.d/35_fwupd ###

### 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 ###
fait

Thanks a lot in advance!

I think you need to remove all those old linux distro entries with efibootmgr.

Example: sudo efibootmgr -b <bootnum> -B

Edit:
The next thing to do is in the boot loader configuration file uncomment this line.

# GRUB_DISABLE_OS_PROBER="false"

Then run the grub update command.

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

This Arch wiki article might help you.

IIRC, you can use os-prober for that. You would have to change a setting inside the configuration file for it, after you install the package. Regenerate GRUB and its entries afterwards. I would say, however, that it isn’t advised to do that, as Windows and GRUB don’t like each other very much. Very likely, you have a boot entry in your BIOS menu for Windows. You probably should use that if you don’t want to wake up suddenly with a non working OS.


This is a completely other topic. Maybe say that after you’ve helped him out/tried to.

1 Like

Really? The OP asked and i just answered this first. :wink:

The efibootmgr is cleaner :slight_smile:

efibootmgr
BootCurrent: 0009
Timeout: 2 seconds
BootOrder: 0006,0008,0002,0009,9999
Boot0002* Windows Boot Manager  HD(3,GPT,dfc98513-1cd7-4b9d-bb7a-80d4f23388c3,0x7564800,0x96000)/\EFI\Microsoft\Boot\bootmgfw.efi57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000061000100000010000000040000007fff0400
Boot0006* arch  HD(5,GPT,58804c5e-e93c-4fc2-a37c-05b5638e0cfa,0xcb9e000,0x3e8000)/\EFI\arch\grubx64.efi
Boot0008* Linux Boot Manager    HD(5,GPT,58804c5e-e93c-4fc2-a37c-05b5638e0cfa,0xcb9e000,0x3e8000)/\EFI\systemd\systemd-bootx64.efi
Boot0009* Internal Hard Disk    PciRoot(0x0)/Pci(0x1,0x2)/Pci(0x0,0x0)/NVMe(0x1,00-1B-44-4A-44-E4-71-E5)/HD(5,GPT,58804c5e-e93c-4fc2-a37c-05b5638e0cfa,0xcb9e000,0x3e8000)0000424f
Boot9999* USB Drive (UEFI)      PciRoot(0x0)/Pci(0x1d,0x0)/USB(16,0)0000424f
1 Like

I’ve enabled os-prober in /etc/default/grub & ran sudo grub-mkconfig -o /boot/grub/grub.cfg

Rebooting…

1 Like

Well, things did not turn exactly the way we expected!

but I still have an access there:

the 1st entry brings me back to the “UEFI firmware setting GRUB”
The 2nd & 3rd to EOS boot menu

The one say’s arch? Did you have arch installed before? Did you try the one that say’s linux boot manager?

“arch” leads me to the “empty” GRUB
“linux boot manager” as well as “windows boot manager” lead me to the EOS GRUB

I guess what you’ll have to do is boot on the live ISO and arch-chroot. Then reinstall grub and run the update grub command.

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

Do you know how to arch-chroot into the installed system?

Edit: arch-chroot

https://discovery.endeavouros.com/system-rescue/arch-chroot/2022/12/

Not sure why this happened? It’s a UEFI thing. Par for the course.

Nope! But I’m willing to learn that!

I’ll try that:

  • chroot through the live-CD
  • run the following commands: sudo grub-install then sudo grub-mkconfig -o /boot/grub/grub.cfg

Am I right?

The instructions for arch-chroot are in the wiki link i gave you. It’s simple really. You just have to boot on the live ISO and then mount the root partition and the efi partition that is boot with the correct commands and path. Then arch-chroot into the mount. It’s explained in the wiki depending on your set up which i hope isn’t elaborate. There are instructions if you are using btrfs or ext4 etc.

Edit: Need help just ask.

You could post the output for lsblk

Edit: Example of how arch-chroot is done. :wink:

sudo mount /dev/xxxx /mnt
sudo mount /dev/xxxx /mnt/boot/efi

sudo arch-chroot /mnt

1 Like

Online install without installing endeavourtools and config?

Or just install with arch?

Not sure indeed what to do there: my / partition must be the one labelled "nvme0n1p3

But when I try to mount it, I got an error

Mis a letter

1 Like

“n” missing

edit: sorry ringo, I’ve been late :upside_down_face:

1 Like

Well done folks!
My old eyes are not what they were!!

May I ask now what I should do?

you have to chroot :smile:

Sudo grub-install , make a new entry if yiu cleaned it up