10

I almost know nothing about coding in Ubuntu. I am currently dual booting ubuntu 16.04 LTS and Windows 10. Everything was fine . But today an error occured saying

"can't find filesystem"

and then grub rescue begins . After searching for some time I have found out solution that tells to do these:

ls
set prefix=(hd0,msdos5)/boot/grub
insmod normal
normal

I know that ls is listing harddrive partitions(let me know if I am wrong) .Then(in set prefix) I need to select a partition . There came a error when I selected msdos5. After some try I selected msdos6. Then it ran . But the problem is that from another solution to this problem I wrote this code:

set boot=(hd0,msdos6)

I think I messed up . Probably , it involves which partition of the harddisks is going to boot .Now, my laptop is running after writing this code and every time I turn on the laptop the boot stuck at the beginning showing the same error & I need to write the code every time I need to run the laptop . How can I solve this issue? I probably also need to know the partition which is booting (msdos*) & I don't know how to find that.

Utshaw
  • 555

2 Answers2

19

I got a solution for this type of problem if grub rescue> prompt occurs in booting time and you have to write a code like:

grub rescue> ls
grub rescue> set boot=(hd0,msdos*)
grub rescue> set prefix=(hd0,msdos*)/boot/grub
grub rescue> insmod normal
grub rescue> normal

After boot Linux/Ubuntu based OS will load then open a terminal and write the command:

useranf@ ~ $ sudo update-grub

then type this command:

useranf@ ~ $ sudo grub-install /dev/sda

after these operation now finally reboot your system.

muru
  • 207,228
1

In the above answer by deepak bundela, i think the following line needs to be corrected:

grub rescue> set boot=(hd0,msdos*)

to:

grub rescue> set root=(hd0,msdos*)

(am repeating the * as bundela put it so as not to distract from the real issue)

i was unable to find a grub environment variable called boot, and as far as i recall it has always been set root=()

i am somewhat confused by all the commenters who said that it worked on their distros. did they do a set boot or a set root?

at the grub rescue> prompt, if one just types set it lists all the env variables that have been set. in all my grub rescue adventures, i've never seen the boot env variable being listed.