To fix grub rescue go with following steps:
First thing is we have to start our OS only then after we can fix
grub.
#to start OS-->
error: unknown filesystem.
Entering rescue mode...
grub rescue>
When you see such an error first we have to check for “Filesystem” is ext2'
grub rescue> ls # type 'ls' and hit enter to see drive partition.
(hd0) (hd0,msdos6) (hd0,msdos5) (hd0,msdos4) ... # you will see such things
this are our drives now we have to check which one is ext2.
grub rescue>ls (hd0,msdos6)
error: disk 'hd,msdos6' not found.
go for another drives until you get “Filesystem is ext2”.
grub rescue>ls (hd0,msdos5)
error: disk 'hd,msdos5' not found.
grub rescue>ls (hd0,msdos2)
(hd0,msdos2): Filesystem is ext2 # this is what we want
now set the path
grub rescue>set boot=(hd0,msdos2)
grub rescue>set prefix=(hd0,msdos6)/boot/grub
grub rescue>insmod normal
grub rescue>normal
make sure you must update grub after login into OS
If you installed from a USB live media, you are probably experiencing bug 384633, where the initial creation of the grub boot config file uses a wrong device instead of a UUID. If you can boot off the live media, you can reinstall grub to the external usb disk, and that should fix the grub config file. You can also edit the grub boot commands (commands on screen to edit and boot) to fix the wrong devices. For the last few years, the fix was to simply reduce the disk letter or number by one, and upon successful boot, immediately run
sudo update-grub
With 12.10, the wrong device has changed, it may even be sda (which is usualy the internal hard disk). In 12.10, I have started seeing the disk lettering change, with the internal hard disk sometimes sdb instead of sda -- not even consistent. But after the update-grub, UUIDs will be used, and the disk letter will no longer matter. Feel free to add yourself to the bug, and maybe someday it will be fixed.
Best Answer
If you were able to boot Ubuntu in the past, but not now, follow these steps to solve the problem.
First type
ls
command and Press Enter to see all the available partitions. The entries will be shown as(hd0,msdos1) (hd0,msdos2) (hd0,msdos5)
etc.Then type
ls (hd0,msdos1)/
to see the content of the drive. if you see entries likevmliuz
orinitrd
, it is your Linux partition. If you fail with (hd0,msdos1), try with (hd0,msdos2) and so on, until you recognize your Ubuntu partition.When you correctly identify your Ubuntu partition, type
root=(hdX,msdosX)
, replace theX
with correct identified number. For example, if you seevmlinuz
andinitrd
entries by enteringls (hd0,msdos5)
, the command will beroot=(hd0,msdos5)
.then type
configfile /boot/grub/grub.cfg
and type Enter. This will bring you Previous Ubuntu grub menu.Then choose the entry to boot Ubuntu.
After you booted up, Open a terminal and type
sudo update-grub
and press Enter. This will update the grub menu and prevent future problems.In the case that you are not able to boot to Ubuntu after installation, re-installing Ubuntu is the best option. You can check this question: