So I broke my grub the other day while doing some hardware upgrades. I will guide you how to fix broken grub if you are on Manjaro or Arch.
My setup is quite complex, I have 4 drives(3 SSD, 1 HDD) with Manjaro as my main OS and Ubuntu and Windows as a side loader. Boot loader is on Manjaro drive.
Your mileage, reasons and errors may vary from mine.
Note: You don’t need to boot from a live image in this resolution, we will fix it up from the grub rescue.
1st thing you can do is list all the drives and partitions with
ls. Now keep exploring to find out which drive you have installed your OS and grub. For that you can list the files of the drive with
ls (hd0,gpt1)/. In my case it was
(hd0,gpt5), means 1st drive with partition 5. You will see boot/grub or efi/boot/grub or efi/grub etc in your OS installed drive.
Once you find out which drive and partition, next is to boot to it. Now run the following commands but change the paths where needed.
set prefix=(hd0,gpt5)/boot/grub set root=(hd0,gpt5) insmod linux insmod normal normal
After typing everything correctly, you should be able to boot to your OS. Once logged in, open terminal and install grub and then update it. I have installed grub on sda, your could be same or different. Just make sure it is the correct drive.
sudo grub-install /dev/sda sudo update-grub
That should reinstall grub and update it with the OS you have installed.