No GRUB after Windows 10 install: how to recover?

Hi there,

I had EOS in a laptop and yesterday I installed Windows 10. Now I can access both OS only through the Acer’s boot menu (F12).

But I have no GRUB anymore, after Windows 10 installation. I read a lot of things but don’t understood very well how to recover it.

I have separate partitions for /, /home and also for Windows.

Below is the output of lsblk and fdisk -l:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 894,3G  0 disk 
├─sda1   8:1    0   300M  0 part /boot/efi
├─sda2   8:2    0 105,5G  0 part /
├─sda3   8:3    0 605,5G  0 part /home
├─sda4   8:4    0   100M  0 part 
├─sda5   8:5    0    16M  0 part 
├─sda6   8:6    0 182,4G  0 part 
└─sda7   8:7    0   532M  0 part 
sdb      8:16   0 465,7G  0 disk 
└─sdb1   8:17   0 465,7G  0 part /run/media/eos-lnx/Sandisk_Ext
Disco /dev/sda: 894,25 GiB, 960197124096 bytes, 1875385008 setores
Modelo de disco: KINGSTON SA400S3
Unidades: setor de 1 * 512 = 512 bytes
Tamanho de setor (lógico/físico): 512 bytes / 512 bytes
Tamanho E/S (mínimo/ótimo): 512 bytes / 512 bytes
Tipo de rótulo do disco: gpt
Identificador do disco: 4F4CC4B3-D114-41AA-9BC9-629AE2089B33

Dispositivo     Início        Fim    Setores Tamanho Tipo
/dev/sda1         2048     616447     614400    300M Microsoft dados básico
/dev/sda2       616448  221800447  221184000  105,5G Linux sistema de arquivos
/dev/sda3    221800448 1491560447 1269760000  605,5G Linux sistema de arquivos
/dev/sda4   1491560448 1491765247     204800    100M Sistema EFI
/dev/sda5   1491765248 1491798015      32768     16M Microsoft reservado
/dev/sda6   1491798016 1874291930  382493915  182,4G Microsoft dados básico
/dev/sda7   1874292736 1875382271    1089536    532M Windows ambiente de recuperação


Disco /dev/sdb: 465,73 GiB, 500074299904 bytes, 976707617 setores
Modelo de disco: Extreme 55AE    
Unidades: setor de 1 * 512 = 512 bytes
Tamanho de setor (lógico/físico): 512 bytes / 512 bytes
Tamanho E/S (mínimo/ótimo): 512 bytes / 1048576 bytes
Tipo de rótulo do disco: gpt
Identificador do disco: 8CAAC551-704B-4609-B26B-A68E1B1A7605

Dispositivo Início       Fim   Setores Tamanho Tipo
/dev/sdb1     2048 976705568 976703521  465,7G Microsoft dados básico

So, how could I recover GRUB, for example, in order to be able to select what OS I want to boot?

I would be very grateful for any help.

Boot the ISO in UEFI mode.

Follow this wiki to chroot into your system:
https://discovery.endeavouros.com/system-rescue/arch-chroot/2022/12/

Then follow this guide to repair grub for UEFI systems:
https://discovery.endeavouros.com/system-rescue/repair-a-non-booting-grub/2021/03/

Maybe it is just a question of changing the boot priority in the bios settings?

Could you post the output of:

efibootmgr

?

@dalto ,

Thanks, I will try.

@pebcak

So, below is the output:

BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0001,0002,2001,0003,2002,2003
Boot0001* Windows Boot Manager	HD(4,GPT,fd88d38b-9185-4db4-a1f3-08fb81eeedf1,0x58e76800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d0000002e000100000010000000040000007fff0400
Boot0002* endeavouros	HD(1,GPT,66d8cee5-10ec-47ba-9b11-7c9866eed2c4,0x800,0x96000)/File(\EFI\endeavouros\grubx64.efi)
Boot0003* EndeavourOS-grub	HD(1,GPT,66d8cee5-10ec-47ba-9b11-7c9866eed2c4,0x800,0x96000)/File(\EFI\EndeavourOS-grub\grubx64.efi)
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot2003* EFI Network	RC

But, I would like to have that menu so I could choose an OS. :slight_smile:

So, maybe it is not necessary to chroot and repair GRUB?

You could try changing the boot order so 0002 and 0003 come before 0001. In that case, you might not have to reinstall grub.

So, this is strange.

At BIOS I have only the below options:

If windows overwrote your EFI partition, you may need to install grub as I described in the second post.

If you mount the efi partition from the live ISO you can take a look at what it is in EFI

Understood. So, as per the results I have while on BIOS, it seems Windows really overwrote my EFI partition, right?

I’ll try that, so. Thank you so much.

Well, the chhroot part was done.

But now I tried to follow that guide to install GRUB again, receive the below error:

grub-install --target=i386-pc /dev/sda1
Installing for i386-pc platform.
grub-install: warning: File system `fat' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.

/dev/sda1 is my /boot/efi partition, previously to Windows install.

You are following the instructions for BIOS. You need to follow the UEFI instructions.

That page has more than one set of instructions. Please don’t just type the commands in order.

Thank you very much, @dalto . :slight_smile:

My bad, sorry for that. I printed the instructions, in order to properly use them while on live media, but forgot to notice that UEFI section.

So, now I think I am almost reaching the perfect setup. Well, I chrooted and repaired GRUB. I have also enabled os-prober on /etc/default/grub.

Now when I reboot EOS is being booted. To access Windows, I have to press F12 to access the Acer’s boot menu and choose Windows (this is the opposite to what was happening before). This is very good, of course.

But no Windows 10 entry is displayed in the GRUB when I boot the machine. Do you know how can I fix this, please?

Thanks once again.

Did you run sudo grub-mkconfig -o /boot/grub/grub.cfg after enabling os-prober?

Yes. Just after changing the values in the file.

Was that before or after enabling os-prober in /etc/default/grub

Hum, I think it was after. Do you know if I can do all the procedures again without problems?

Don’t do them all again.

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

That rebuilds the grub boot menu. You can run it anytime you make changes impacting the boot menu.

Just done that, but no changes. Windows entry in boot menu still don’t showing.

After this command, os-prober ran and displayed an error, but just for my removable media. This is OK, I think.

But no Windows entry, for now, unfortunately. :frowning: The OS can be loaded, of course, but only through that Acer boot menu.

Can you share the output of sudo grub-mkconfig

Sure, here it goes:

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  1fd2c93a-4706-4541-a09a-6a25c27c67d3
else
  search --no-floppy --fs-uuid --set=root 1fd2c93a-4706-4541-a09a-6a25c27c67d3
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=pt_BR
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
Found background: /usr/share/endeavouros/splash.png
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  1fd2c93a-4706-4541-a09a-6a25c27c67d3
else
  search --no-floppy --fs-uuid --set=root 1fd2c93a-4706-4541-a09a-6a25c27c67d3
fi
insmod png
background_image -m stretch /usr/share/endeavouros/splash.png
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/intel-ucode.img /boot/initramfs-linux.img
menuentry 'EndeavourOS Linux' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-1fd2c93a-4706-4541-a09a-6a25c27c67d3' {
	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  1fd2c93a-4706-4541-a09a-6a25c27c67d3
	else
	  search --no-floppy --fs-uuid --set=root 1fd2c93a-4706-4541-a09a-6a25c27c67d3
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=1fd2c93a-4706-4541-a09a-6a25c27c67d3 rw  nowatchdog nvme_load=YES nvidia-drm.modeset=1 loglevel=3
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
}
submenu 'Advanced options for EndeavourOS Linux' $menuentry_id_option 'gnulinux-advanced-1fd2c93a-4706-4541-a09a-6a25c27c67d3' {
	menuentry 'EndeavourOS Linux, with Linux linux' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-1fd2c93a-4706-4541-a09a-6a25c27c67d3' {
		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  1fd2c93a-4706-4541-a09a-6a25c27c67d3
		else
		  search --no-floppy --fs-uuid --set=root 1fd2c93a-4706-4541-a09a-6a25c27c67d3
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=1fd2c93a-4706-4541-a09a-6a25c27c67d3 rw  nowatchdog nvme_load=YES nvidia-drm.modeset=1 loglevel=3
		echo	'Loading initial ramdisk ...'
		initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
	}
Found fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img
	menuentry 'EndeavourOS Linux, with Linux linux (fallback initramfs)' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-1fd2c93a-4706-4541-a09a-6a25c27c67d3' {
		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  1fd2c93a-4706-4541-a09a-6a25c27c67d3
		else
		  search --no-floppy --fs-uuid --set=root 1fd2c93a-4706-4541-a09a-6a25c27c67d3
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=1fd2c93a-4706-4541-a09a-6a25c27c67d3 rw  nowatchdog nvme_load=YES nvidia-drm.modeset=1 loglevel=3
		echo	'Loading initial ramdisk ...'
		initrd	/boot/intel-ucode.img /boot/initramfs-linux-fallback.img
	}
}

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

### BEGIN /etc/grub.d/15_ostree ###
### END /etc/grub.d/15_ostree ###

### 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 ###
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/sda4@/efi/Microsoft/Boot/bootmgfw.efi
menuentry 'Windows Boot Manager (on /dev/sda4)' --class windows --class os $menuentry_id_option 'osprober-efi-7E07-1F07' {
	insmod part_gpt
	insmod fat
	set root='hd0,gpt4'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  7E07-1F07
	else
	  search --no-floppy --fs-uuid --set=root 7E07-1F07
	fi
	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 ...
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/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

There are appears to be an entry for Windows there.