Skip to content

Instantly share code, notes, and snippets.

@SalahAdDin
Created January 21, 2019 14:48
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SalahAdDin/944be0154d0c581cba91735e27352447 to your computer and use it in GitHub Desktop.
Save SalahAdDin/944be0154d0c581cba91735e27352447 to your computer and use it in GitHub Desktop.
Repairing Arch/Manjaro Grub

If we have access to the grub rescue, we can do the next steps:

grub rescue > ls
(hd0)... (hd0,gpt8)...
grub rescue > ls (hd2,gpt8) # try to recognize which partition is this
grub rescue > ls (hd2,gpt6) # let's assume this is the linux partition
grub rescue > set root=(hd2,gpt6)
grub rescue > set prefix=(hd2,gpt6)/boot/grub # or wherever grub is installed
grub rescue > insmod normal # if this produced an error, reset root and prefix to something else ..
grub rescue > normal

After these, you will get access to the grub, choose your linux system and get into. Once in your linux system, reinstall and reset the grub:

sudo grub-install
sudo  grub-mkconfig -o /boot/grub/grub.cfg

That's all, now you can reboot your system if you want to test that grub is working.

@Tridence
Copy link

The last part of code didn't work for me. So I used:

sudo grub-install --target=i386-pc --recheck /dev/sda
sudo update-grub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment