Multi-OS booting after /boot/efi was reformatted

Hi All,

Is there a way (or tools) to rebuild grub’s data or use Refind to have a multi-OS system, including preinstalled Windows with a new /boot/efi partition? My laptop has W10 preinstalled and when EndeavourOS is installed the /boot/efi partition was accidentally formatted and now grub menu does not have an entry for booting W10.

Any pointer will be appreciated.

TIA.

Hello @nhutnn
Are you sure that you formatted it? Did you install using a manually created partition method?

Edit: Post this command

efibootmgr

Hi @ricklinux,

I did install using the manual partitioning method. The /boot/efi partition was reused but ‘format’ was selected instead of ‘keep’. Refind was installed today and here is the output of efibootmgr:

nn@nn-m142 $ efibootmgr
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0004,0000,0001,0002,0003,0005
Boot0000* EndeavourOS
Boot0001* rEFInd Boot Manager
Boot0002* UEFI:CD/DVD Drive
Boot0003* UEFI:Removable Device
Boot0004* UEFI OS
Boot0005* UEFI:Network Device

Thanks!

If you installed rEFInd you’ll be able to boot both but that won’t fix the Windows boot loader.

Grub is separate and in order to fix the Windows boot loader you would have two options. If you have the original install disc or usb you can boot off it and fix it. Or you can boot windows in one of the repair modes and fix it possibly. But if it doesn’t work you may need the disc which you could download an ISO of Windows 10.

But you can get rEFInd to boot both. Just go into your Uefi when you boot the system and change the boot order. Or here is way to change it in Linux.

sudo efibootmgr -o 0001, 0000, 0002, 0003, 0004, 0005

If you switch it to boot rEFInd you’ll have to change the setup on the rEFInd screen to not use the grub loader but to boot the vmlinz-linux. I think it’s option 4

https://endeavouros.com/docs/installation/how-to-install-refind/

I will post the instructions to fix the windows bootloader but keep in mind you’ll have to possibly boot on the live iso and chroot and fix grub in order to have windows and Endeavour booting properly.

You are going to have to boot off a windows 10 usb to repair the windows bootloader.

@ricklinux

Many thanks! I guess if I want to revive the Win10 OS I need to rely on a Win10 USB.

I was hoping that os-prober can be used but apparently it is not the case. I will use Win10 USB when needed.

Thanks again!

Were you able to get rEFInd set up to get into it?

Edit: if you are able to boot Windows 10 you can try the repair for the boot by holding down the shift key and clicking on restart to get Windows to go into advanced startup mode. From there you can try the the automatic repair or do from command line.

For some reasons I could not get rEFInd working. I even reinstall it just now but when I boot the machine it goes to grub menu showing EndeavoursOS and snapshots.

What do you mean snapshots?

The laptop was setup using this guide by 2000:

https://forum.endeavouros.com/t/howto-gpt-uefi-install-with-full-disk-encryption-btrfsonluks-with-separate-root-home-and-pkg-subvolumes-hibernation-with-a-swapfile-auto-snapshots-with-easy-system-rollback-gui-boot-into-snapshots/

System snapshots are generated when upgrading (or optionally when booting) and grub can boot the machine into a snapshot, in case something wrong with updates.

You just did this now reinstalling? If you were going to reinstall maybe you should have fixed the Windows boot first?

EndeavourOS was installed a while back and I reinstalled rEFInd today.

This machine is new without a lot of personal data so worst come to worst I will reinstall W10 if needed, so it is not a big deal.

Thanks for your help.

I here you …i was just trying to save you a step. Why doesn’t rEFInd work for you? I just actually installed it on mine yesterday.

I am not sure why either. I installed rEFInd on other laptops before and it works like a charm, but not on this laptop. Maybe it has something to do with BIOS settings.

When you install rEFInd you have to change the boot to rEFInd in your boot menu in UEFI. Then when you boot the rEFInd menu comes up instead of grub. Then you have to make the changes in rEFInd menu to boot the right items because you want it to boot from vmlinux-linux rather than grub. The icons in the menu will have both so you hide grub ones and anything else you don’t need in the menu. I’m not sure how snapshots and all that setup works as I don’t use it.