Edit: I found a more comprehensive and cleaner response here: Grub rescue prompt, repair grub
I got into grub rescue after changing the swap partition. So no hardware problem or deleted files.
First thing for me to figure out was the keyboard layout. As far as I could tell it is en_us. To know this is essential because you need at least some, to type the console commands.
Now with the ls
command you can search for your OS partition. Just check every partition listed with ls (hd0,msdos5)/
to check their content. As far as I can tell if you know your partition number (ex. sda5) you can use ls (hd0,5)/
as well. As soon as you find the right partition it lists the root folders. You need to know the path to the root folder and the grub folder.
Then type set prefix=(hd0,5)/boot/grub
and set root=(hd0,5)
. While replacing your own partitions.
Now type insmod linux
and insmod normal
. If no error occurs, you can boot by typing normal
.
If the boot works, you need to fix grub. Check for tutorials for that.
I write this answer because I found it first, while having this problem. A reinstall would be possible but silly.
Is there any way to rescue at least my own files.
Which files? you have something important on a virtual machine? Which instructions are you following to get out of grub rescue? – kashish Jul 15 '20 at 09:23