I have a Windows 10 install on an NVMe drive. I've installed Ubuntu 20.04 and all installed smoothly, until the first boot. I was greeted with a grub prompt.
grub>
After searching the forums and finding a wealth of information, I've been able to issue the following command and reach GRUB bootloader (and both Windows and Ubuntu load correctly from there):
grub> configfile (hd1,gpt5)/boot/grub/grub.cfg
However, when I reboot, I'm back to the grub command line. I've also found the following commands from the forums:
grub> set root=(hd1,gptN)
grub> set prefix=(hd1,gptN)/boot/grub/
grub> insmod normal
grub> normal
These commands also bring me to my grub menu and I can safely boot into either OS (Windows or Ubuntu). The problem is that I have to do this each time. Thus, I'm trying to make a permanent change to my grub settings.
Once in Ubuntu, I can update grub from the command line, and I can also reinstall grub. Both with the following.
$: sudo update-grub
$: sudo grub-install /dev/nvme0n1pX
However, I'm at a loss of how to ensure the correct partition number for X in the grub-install command. Is it as simple as N from the root/prefix commands within the above grub terminal? Or is there more definitive way to check which partition number to choose?
Any help is much appreciated.