Recovering from 'grub rescue>' crash

This answer is for others out there that DocSalvager's answer doesn't work for.

  1. I followed DocSalvager's use of ls to find the correct hard drive partition. In my case it was (hd0,msdos5).
  2. Then I executed the following commands to get back to the normal grub boot loader screen.

    grub rescue>  set boot=(hd0,msdos5)
    grub rescue>  set prefix=(hd0,msdos5)/boot/grub
    grub rescue>  insmod normal  
    grub rescue>  normal  
    
  3. After booting into Ubuntu I repaired the grub boot loader with the following commands from the terminal.

    sudo grub-install /dev/sda 
    

Please reference this source for a visual walk through of this process.


Recovering from a grub rescue crash ...

  • grub rescue> does not support cd, cp or any other filesystem commands except its own variation of ls which is really a kind of find command.
  • So first, had to find the partition with the /boot directory containing the vmlinuz and other boot image files...

    grub rescue>  ls  
    (hd0,4) (hd0,3) (hd0,2) (hd0,1)  
    
    grub rescue>  ls (hd0,4)/boot
    ... some kind of 'not found' message
    
    grub rescue>  ls (hd0,3)/boot
    ... some kind of 'not found' message
    
    grub rescue>  ls (hd0,2)/boot
    ... grub ... initrd.img-2.6.32-33-generic ... vmlinuz-2.6.32-33-generic 
    
    • ls without arguments returns the four partitions on this system.
    • ls (hd0,4)/boot does not find a /boot directory on partition (hd0,4).
    • ls (hd0,3)/boot does not find a /boot directory on partition (hd0,3).
    • ls (hd0,2)/boot finds a /boot directory on partition (hd0,2) and it contains a vmlinuz and other boot image files we want.
  • To manually boot from the grub rescue> prompt ...

    grub rescue>  set root=(hd0,2)/boot  
    grub rescue>  insmod linux  
    grub rescue>  linux (hd0,2)/boot/vmlinuz-2.6.32-33-generic  
    grub rescue>  initrd (hd0,2)/boot/initrd.img-2.6.32-33-generic  
    grub rescue>  boot  
    
    • Set root to use the /boot directory on partition (hd0,2).
    • Load grub module linux.
    • Set that module to use the kernel image vmlinuz-2.6.32-33-generic.
    • Set initrd(init RAM disk) to use the image initrd.img-2.6.32-33-generic.
    • Boot Linux.
  • This boots to a BusyBox commandline prompt which has all the basic filesystem commands (and then some!).

  • Then could move the *.mod files back to the /boot/grub directory ...

    busybox>  cd /boot  
    busybox>  mv mod/* grub
    busybox>  reboot
    
  • Successful Reboot!

See also ...

  • stuck at grub rescue on boot, no bios, no live cd, ls returns hd0
  • recovering from grub rescue crash (AskUbuntu)
  • how to fix error unknown filesystem grub rescue (AskUbuntu)
  • A nice Grub 2 ls command reference page
  • BusyBox (website)
  • BusyBox online emulator