grub rescue>
Jul. 30th, 2019 08:33 pmI have a laptop, as it so happens a PC Specialist "Cosmos" laptop from 2016. If you know me, you won't be surprised to know that it dual boots Linux (Debian) and Windows. This generally works very well... until there is a six-monthly Windows update, which trashes the bootloader every single time (at least the last three, anyway). This isn't actually hard to fix, but it's always tricky to fix the exact instructions on how to do it, especially when I'm reducing to browsing on my phone... so this post is mostly an aide-mémoire for myself in six months time, but might be useful for someone else as well...
At the grub rescue> prompt, type ls. You'll then see something like:
(hd0) (hd0,gpt7) (hd0,gpt6) (hd0,gpt5) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) (hd1)
Iterate over each of the "gpt" entries (e.g. ls (hd0,gpt1) etc) until you find one that says (hd0,gpt5): filesystem is ext2. rather than (hd0,gpt1): filesystem is unknown. Once you've found that, it's then just a matter of:
grub rescue> set prefix=(hd0,gpt5)/boot/grub
grub rescue> set root=hd0,gpt5
grub rescue> insmod normal
grub rescue> normal
and you're then back at the regular GRUB menu. Boot Linux and then:
$ sudo update-grub
$ sudo grub-install
and you should be back in happy land again.
At the grub rescue> prompt, type ls. You'll then see something like:
(hd0) (hd0,gpt7) (hd0,gpt6) (hd0,gpt5) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) (hd1)
Iterate over each of the "gpt" entries (e.g. ls (hd0,gpt1) etc) until you find one that says (hd0,gpt5): filesystem is ext2. rather than (hd0,gpt1): filesystem is unknown. Once you've found that, it's then just a matter of:
grub rescue> set prefix=(hd0,gpt5)/boot/grub
grub rescue> set root=hd0,gpt5
grub rescue> insmod normal
grub rescue> normal
and you're then back at the regular GRUB menu. Boot Linux and then:
$ sudo update-grub
$ sudo grub-install
and you should be back in happy land again.