I installed Ubuntu 21.10 on a new machine. Then I needed to dual boot Windows 10, so I booted to a live USB and shrunk the Ubuntu partition. Windows installed fine, but apparently squashed GRUB. I was able to recover using boot-repair
from the live USB, but it boots to the GRUB prompt, where I have to manually:
set (seems to remember these between boots after I do it once):
prefix=(hd0,gpt2)/boot/grub
root=hd0,gpt2
I have to manually:
grub> linux /boot/vmlinuz-5.13.0-22-generic root=/dev/nvme0n1p2
grub> initrd /boot/initrd.img-5.13.0-22-generic
grub> boot
This successfully boots me into Ubuntu. Once there, I ran boot-repair
again. but when I reboot, I'm back at the GRUB prompt. I'd like a GRUB menu showing Ubuntu, Windows, etc.
Here's boot-repair
's report:
https://paste.ubuntu.com/p/FRgPjN9BGr/
note: I cobbled the above together from googling. I don't really understand what I'm doing and don't have experience with GRUB or bootloaders.
UPDATES:
i tried boot-repair
from the live USB again.
-if i use the recommended repair, it seems to do nothing other than generate this report: https://paste.ubuntu.com/p/xVXDqGPykW/
the results are the same as before (fails to boot and winds up at GRUB prompt with "Failed to open \EFI\UBUNTU Failed to load image \EFI\UBUNTU\ start_image() returned Invalid Parameter, falling back to bootloader")
-if i try "advanced" and don't change any options, i get the same as above with this report: https://paste.ubuntu.com/p/hbr7tpRFdZ/
-if i try "advanced" and add "Purge GRUB before reinstalling it," i get a dialog that says "GRUB is still present. Please try again." this is after confirming to remove GRUB after being asked to run:
sudo apt-get purge --allow-remove-essential -y grub*-common shim-signed
at that point, i have no choice but to cancel.
-if i try "advanced" and add both GRUB purge and "Purge kernels then reinstall last kernel," it's been stuck for over an hour on "Purge kernels then reinstall last kernel on nvme0n1p2 (pur). This may require several minutes..."