Especially this info for an EFI boot eg Lenovo or similar.
Do NOT use Grub Customizer. It has no idea of EFI and indiscriminately writes the grub to wrong locations. So, I did use Grub Customizer and here is how I fixed it:
Cause: boot process can’t find the root partition
At the Grub: prompt type ls This will show all partitions, and then type individual
ls (hd0,1)/ (on a Lenovo Laptop, you will find a series of (hd0,gpt1) through to gpt7)
… and so on, until you find like
(hd0,1)/boot/grub or (hd0,1)/grub (on a Lenovo dont be missled by /boot or /efi on earlier partition eg gpt1)
In case of EFI, (on Lenovo your most likely, is the actual ubuntu install location eg gpt6 this will be indicated by a bunch of ubuntu (root) directories including a /boot. Do NOT get confused by below information with Lenovo; you should find a boot/grub, then try eg ls (hd0,gpt6)/boot/grub
now you should see the proper grub files and follow instructions below to get yourself back into the party:)
(hd0,1)/efi/boot/grub or (hd0,1)/efi/grub… now set the boot parameters accordingly, just type this with your number
set prefix=(hd0,1)/grub (Lenovo would be similar to this: set prefix=(hdo,gpt6)/boot/grub)
now it should boot.
When back in Linux You could open the Terminal #sudo update-grub
If this fails when you next reboot you are back in stupid Grub: again, repeat the previous steps and ONLY DO THIS IF YOU ARE EFI BOOT:
next time you get your ubuntu firing enter terminal:
#sudo grub-install --uefi-secure-boot
Finally you should be able to boot as previous.