Can't solve grub rescue problem?

9,025

1) From grub rescue:

Type the following commands:

ls (hd0,msdos8)/
set root=(hd0,msdos8)
set prefix=(hd0,msdos8)/boot/grub
insmod linux
insmod normal
normal
boot

If you get an error with insmod normal try with insmod.old or insmod linux

2) Boot from live CD

Reinstall Linux images on your boot partition

sudo mount /dev/sday /mnt/myroot/boot 

and

   sudo mount ‐‐bind /dev /mnt/myroot/dev
   sudo mount ‐‐bind /proc /mnt/myroot/proc
   sudo mount ‐‐bind /sys /mnt/myroot/sys

Mount all of your other partitions /boot,/var,/usr,/tmp etc. Make sure you have mounted them all.

Copy resolv.conf

 cp -L /etc/resolve.conf /mnt/example/etc/resolve.conf

chroot

 sudo chroot /media/bin:/sbin:/usr/bin:/usr/sbin /mnt/tmp...

Reinstall missing kernel image

move initrd.img from root:

   mv initrd.img initrd.img.OLD

install Linux image

  apt-cache search 'linux-image'
  apt-get install linux-image-x.x-generic

Replace linux-image-x.x-generic with yours.

restore grub

sudo grub-install /dev/sdX

Reboot

Share:
9,025

Related videos on Youtube

LaravelOnly
Author by

LaravelOnly

Updated on September 18, 2022

Comments

  • LaravelOnly
    LaravelOnly over 1 year

    I installed kali 1.0.9a-amd64 a month ago on dual boot with windows 7,I created 4 partitions from it, one swap one /home one /boot and one / yesterday

    I wanted to free another partition from windows for Ubuntu server so freed 10GB with wizard, downloaded from internet(same I used for kali, went well) went fine, today morning when I started my computer I had grub rescue mod. I couldn't solve it.

    I tried almost everything. I can't even open BIOS. It doesn't work. I tried everything on forums: Found the Linux partition, then tried the set root set prefix method, then insmod normal then normal, on forums on that point it should boot normally and let me be able to fix the grub by reinstalling it. Instead I get the grub normal mode. Now I tried further solutions with that insmod loopback, Linux, iso9660, and fat(since the ISO was on USB) still after that I don't find the casper file nor the vmlinuz.

    I find the vmlinuz just like that as "vmlinuz" no .efi at (hd0,msdos8)/ and I find initrd.img with it at that folder BTW, my prefix isn't /boot/grub its /usr/lib/grub(on forums it says /usr/lib/grub/i386-pc, but if I do that normal mode doesn't start it. Says normal.mod not found,it works with /usr/lib/grub/ though) any solutions please ? I am dying here

    UPDATE :

    After the set root set prefix insmod i went as usual to the normal grub screen,and i tried inintrd initrd.img and it booted into the usb drive,however all the choices(live,install,failsafe....) went too the same screen,black screen with nothing,untill hit ESC then it takes me to another black screen,saying boot: so i entered many choices,none worked,the oly one that seemed like good was /boot/efi.img but still it said failed to load kernel(pressing enter takes me back to the choice screen,the kali boot screen),so i burned ubuntu on the usb stick and now i can boot into it from the usb,i can access internet and stuff,what should i do now to fix it? + I can access BIOS now

    • LaravelOnly
      LaravelOnly about 8 years
      yes regularr BIOS,havent made any change in it,can't acces the bios to make bootrepair mate,i can't no f2 no esc no delete no nothig it simply cant access the BIOS and the proof for that,is when i access the normal grub mode it doesnt show the boot choices as in the other solutions, nothing i can o to access bios,that link,is useless,because i can't boot at all,i can't neither sudo nor bootreapair nor nothing + i am not on ubuntu,am using kalii
    • mchid
      mchid about 8 years
      I've never done it this way but here are some instructions on how to recover from the grub command line. If it doesn't take you to grub rescue, I'm pretty sure you just have to press C to enter grub command line. ibm.com/developerworks/library/l-GRUB2-features
    • mchid
      mchid about 8 years
      Also, Toshiba bios is F2 in case it makes a difference.
    • LaravelOnly
      LaravelOnly about 8 years
      Mate plz read my post carefully,your solution doesn't work i told you it doesn't work that way,i tried that aleady
    • mchid
      mchid about 8 years
      You need to run the individual lines from what should be the regular config one by one as single commands. If I read correctly, (hd0,msdos8) is this the partition that contains Kali. Usually, there is not a separate partition for boot as one is not needed for a standard MBR/ legacy BIOS type setup vmlinuz and initrd.img are usually linked to individual files in /boot so you may have to specify those accordingly using the full path to each file (vmlinuz* and initrd.img*) found in the boot partition instead of (hd0,msdos8).
    • LaravelOnly
      LaravelOnly about 8 years
      1st they don't exist in the /boot partition they exist in the (hd0,msdos8) folder along with /dev /boot /usr ......... and the others 2nd i did specifiy them qccordingly
    • LaravelOnly
      LaravelOnly about 8 years
      false,/boot is empty they can't be a link,though it sounds logic,because it displays same error + could the files be hidden?and thats why it can't display them?nor find them?
    • mchid
      mchid about 8 years
      Well, you said you have a boot partition. What's in the partition? Maybe that's where it is.
  • LaravelOnly
    LaravelOnly about 8 years
    doesn't work + already told you,my prefix is (hd0,msdos8)/usr/lib/grub + when i set it the right way and do the normal command,it takes me o the grub screen if i enter boot there it says error you need to load the kernel first
  • LaravelOnly
    LaravelOnly about 8 years
    doesn't work says error initrd not a command(in the rescue page) if i try it in the grub screen (is displayed after i set root and set prefix and insmod normal) it says need to load kernel first
  • mchid
    mchid about 8 years
    @gad3r I think it says to load the kernel because you forgot to add the initrd and linux lines that specify the location of the initrd and vmlinuz files.