Recover linux from grub rescue

Sometimes something goes wrong with Grub 2 and your Debian, Ubuntu, Mint, etc just does not boot. I’ve got this problem after upgrading Windows 10 (I don’t really get how Windows manages UEFI, it seems a mess, but my Linux boot stopped working)
The only think I could see when trying to boot was grub rescue>

How did I fix it?

I searched online for help and I found some hints.
What I did first was finding out what were my partitions. I wrote the following:

grub rescue > ls

A big list like (hd0) (hd1) (hd1,gpt1) (hd1,gpt2) (hd1,gpt3) (hd1,gpt4) …  (hd1,gpt9) appeared. I knew my linux partition was one of the last ones so I’ve started checking:

grub rescue > ls (hd1,gpt9)/boot
grub rescue > ls (hd1,gpt8)/boot
grub rescue > ls (hd1,gpt7)/boot

After checking the number 7 it returned something like:

./ ../ efi/ vmlinux-3.16-3-amd64 config-3.16-3-amd64 ... etc...

So this was the partition I was looking for.

After that I’ve just run:

grub rescue> set prefix=(hd1,gpt7)/boot/grub
grub rescue> set root=hd1,gpt7
grub rescue> insmod normal
grub rescue> normal

And my linux booted normally to the login screen.

Finally, I opened a root terminal and I reinstall grub (in my case grub-efi because I’am using EFI and not the legacy BIOS boot)

apt-get install --reinstall grub-efi
grub-install /dev/sda
update-grub

A nice link:

https://wiki.debian.org/GrubEFIReinstall

Etiquetas: ,

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

A %d blogueros les gusta esto: