You are not logged in.

#1 2021-12-20 19:44:39

migillope
Member
Registered: 2018-10-22
Posts: 14

[SOLVED] Accidentally killed windows boot manager

During installation, I couldn't boot to GRUB. Fixing it was a process, since for some reason efibootmgr changes were being overwritten by MSI's UEFI settings. In my infinite wisdom, I used some third party applications when booted in windows (EasyUEFI), and straight up deleted the windows boot manager entry. This enabled me to boot into GRUB, at which point I noticed there was no arch entry. I remounted everything, updated grub config, etc, and Arch works fine. However, as one might expect, it broke the windows boot process. GRUB has an entry for it, but whenever I select it, I get a blue screen from Windows with error code 0xc0000225.

My question is, if I go the typical route of creating a Windows 10 Installation Media, booting into it, and running automatic repairs, will it destroy my Arch partitions? I don't particularly care if it breaks GRUB again, that's a straight-forward (if annoying) fix.

Thank you.

Edit: Maybe worth noting, regenerating grub.cfg yields an identical file.

Last edited by migillope (2021-12-20 21:59:30)

Offline

#2 2021-12-20 20:05:51

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Accidentally killed windows boot manager

migillope wrote:

if I go the typical route of creating a Windows 10 Installation Media, booting into it, and running automatic repairs, will it destroy my Arch partitions?

Not in my experience. But still backup beforehand, just in case.

Is there a file at /EFI/Microsoft/Boot/bootmgfw.efi on the EFI system partition? Just deleting the NVRAM entry from Windows shouldn't delete the EFI loader itself.


Jin, Jîyan, Azadî

Offline

#3 2021-12-20 20:17:21

migillope
Member
Registered: 2018-10-22
Posts: 14

Re: [SOLVED] Accidentally killed windows boot manager

Head_on_a_Stick wrote:
migillope wrote:

if I go the typical route of creating a Windows 10 Installation Media, booting into it, and running automatic repairs, will it destroy my Arch partitions?

Not in my experience. But still backup beforehand, just in case.

Is there a file at /EFI/Microsoft/Boot/bootmgfw.efi on the EFI system partition? Just deleting the NVRAM entry from Windows shouldn't delete the EFI loader itself.

Yes, there is. I'll backup and try running the automatic repairs now to see if that fixes it.

Offline

#4 2021-12-20 20:21:58

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Accidentally killed windows boot manager

migillope wrote:

Yes, there is.

Well just create a new NVRAM entry for it from Arch:

# efibootmgr --create --label 'Windows' --disk /dev/sdX --part Y --loader '/EFI/Microsoft/Boot/bootmgfw.efi'

Replace X & Y with the letter & number assigned to the ESP; /dev/sda1 is presumed so if that's correct you can omit those options.


Jin, Jîyan, Azadî

Offline

#5 2021-12-20 20:40:42

migillope
Member
Registered: 2018-10-22
Posts: 14

Re: [SOLVED] Accidentally killed windows boot manager

Head_on_a_Stick wrote:
migillope wrote:

Yes, there is.

Well just create a new NVRAM entry for it from Arch:

# efibootmgr --create --label 'Windows' --disk /dev/sdX --part Y --loader '/EFI/Microsoft/Boot/bootmgfw.efi'

Replace X & Y with the letter & number assigned to the ESP; /dev/sda1 is presumed so if that's correct you can omit those options.

Wouldn't this just allow me to boot into Windows instead of GRUB (assuming I place this superior in the boot order)? Doing this, then dropping into GRUB gives me the same options with the same results. Running grubconfig didn't detect any changes. Though now in efibootmgr I have the new entry for what was just created. I also have two other "Windows Boot Manager" entries, which I find strange.

Last edited by migillope (2021-12-20 20:41:33)

Offline

#6 2021-12-20 20:43:46

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Accidentally killed windows boot manager

Probably best to actually post the output of efibootmgr (preferably with the '-uv' options) rather than just describing it.

Also post the output of 'grub-mkconfig'. FWIW I describe a custom menuentry to boot Windows here: https://bbs.archlinux.org/viewtopic.php … 3#p2010183


Jin, Jîyan, Azadî

Offline

#7 2021-12-20 21:06:33

migillope
Member
Registered: 2018-10-22
Posts: 14

Re: [SOLVED] Accidentally killed windows boot manager

Head_on_a_Stick wrote:

Probably best to actually post the output of efibootmgr (preferably with the '-uv' options) rather than just describing it.

Also post the output of 'grub-mkconfig'. FWIW I describe a custom menuentry to boot Windows here: https://bbs.archlinux.org/viewtopic.php … 3#p2010183

Output of efibootmgr -uv:

BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0002,0004,0008,0003
Boot0000* GRUB	HD(1,GPT,a09ea5b2-bff8-4025-901b-8d5b84bbbb14,0x800,0x32000)/File(\EFI\GRUB\GRUBX64.EFI)
Boot0001* Hard Drive	BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)
Boot0002* Windows	HD(1,GPT,a09ea5b2-bff8-4025-901b-8d5b84bbbb14,0x800,0x32000)/File(\BOOT\EFI\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)
Boot0003  Hard Drive	BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)
Boot0004* Windows Boot Manager	HD(1,GPT,a09ea5b2-bff8-4025-901b-8d5b84bbbb14,0x800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)
Boot0006  Hard Drive	BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)
Boot0008* Windows Boot Manager	HD(1,GPT,a09ea5b2-bff8-4025-901b-8d5b84bbbb14,0x800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)

I attempted your solution in the other thread, but it put me to the same error screen. While I'm at it, here is 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.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,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  a0d2d099-32ae-4cff-8f37-6a7f03263256
else
  search --no-floppy --fs-uuid --set=root a0d2d099-32ae-4cff-8f37-6a7f03263256
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=en_US
  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 ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-a0d2d099-32ae-4cff-8f37-6a7f03263256' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt5'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  a0d2d099-32ae-4cff-8f37-6a7f03263256
	else
	  search --no-floppy --fs-uuid --set=root a0d2d099-32ae-4cff-8f37-6a7f03263256
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=a0d2d099-32ae-4cff-8f37-6a7f03263256 rw  loglevel=3 quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-a0d2d099-32ae-4cff-8f37-6a7f03263256' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-a0d2d099-32ae-4cff-8f37-6a7f03263256' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  a0d2d099-32ae-4cff-8f37-6a7f03263256
		else
		  search --no-floppy --fs-uuid --set=root a0d2d099-32ae-4cff-8f37-6a7f03263256
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=a0d2d099-32ae-4cff-8f37-6a7f03263256 rw  loglevel=3 quiet
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-a0d2d099-32ae-4cff-8f37-6a7f03263256' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  a0d2d099-32ae-4cff-8f37-6a7f03263256
		else
		  search --no-floppy --fs-uuid --set=root a0d2d099-32ae-4cff-8f37-6a7f03263256
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=a0d2d099-32ae-4cff-8f37-6a7f03263256 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 ###
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-B0C0-37C4' {
	insmod part_gpt
	insmod fat
	set root='hd0,gpt1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  B0C0-37C4
	else
	  search --no-floppy --fs-uuid --set=root B0C0-37C4
	fi
	chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

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

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
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 ###

Offline

#8 2021-12-20 21:09:52

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Accidentally killed windows boot manager

Yeah, looks like you'll have to try a Windows repair image. Perhaps the EFI loader has become corrupted.

EDIT: you can use this to remove the superfluous NVRAM entries:

# efibootmgr -b xxxx -B

Replace xxxx with the appropriate bootnumber; zero padding is not needed.

Last edited by Head_on_a_Stick (2021-12-20 21:11:09)


Jin, Jîyan, Azadî

Offline

#9 2021-12-20 21:55:10

migillope
Member
Registered: 2018-10-22
Posts: 14

Re: [SOLVED] Accidentally killed windows boot manager

Alright, I've fixed it. Here is the process for anyone who has the same problem.

Make Windows Installation Media, then boot into it. Then enter the command prompt, reformat the EFI partition (as FAT32), and recreate the boot table. Then reboot.
You'll land in Windows. Create arch installation media. Then boot into that. Mount all your partitions appropriately. Regenerate /etc/fstab (UUID of the boot partition will have changed) and then recreate grub.cfg. I reran grub-install to be safe.

Nothing got erased because we manually repaired the windows boot manager instead of allowing whatever automatic process would have taken place, and everything should be in place.

Thank you Head_on_a_Stick for the help!

Offline

Board footer

Powered by FluxBB