Originally posted to AskUbuntu.com ...

AskUbuntu has adopted a policy of closing questions about EOL (End Of Life) versions. There's a vocal contingent to remove them as well. To prevent possible loss of this popular question (342335 views to date), am placing a revised version here. --- docsalvager

The "classic" system...

  • Puppy Linux 5.2.8 (Lucid) based on Ubuntu 10.04 (Lucid Lynx)
  • GRUB 2 boot loader

GRUB 2 puts a number of *.mod files (kernel modules) in /boot/grub. Deleting these files (thinking they were misplaced sound files) resulted in failure on reboot and the prompt grub rescue>.

How to recover in this situation?

  • 1
    Seems like a dumb question.. obviously you either restore the deleted files from backup, or reinstall grub ( and there are plenty of questions about how to do that already )
    – psusi
    Dec 28, 2014 at 2:08
  • Absolute past viewing statistics are about as relevant as those of yesterday's newspaper.
    – Anthon
    Dec 28, 2014 at 8:03
  • Newspapers from the past have solved countless crimes and been responsible for a great deal of problem-solving that made the world a better place. Dec 30, 2014 at 0:42
  • It would seem to me that booting into rescue mode off the DVD and reinstalling grub from there would probably be ideal. It's probably a lot more straightforward for most people since the mentioned data loss should be restricted to the files in the package.
    – Bratchley
    Dec 30, 2014 at 2:24
  • Not to say that I don't think fishing the specific files out of the initrd isn't clever. I Just think it's likely to confuse people as it is to help. Booting into rescue/recovery mode is a more common procedure.
    – Bratchley
    Dec 30, 2014 at 2:25

2 Answers 2


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.

  • 7
    I'm glad you guys posted before this was closed
    – smac89
    Oct 14, 2015 at 4:47
  • 2
    Perfect - exactly the help I needed to boot! I also ran sudo update-grub before grub-install, because my partition layout had changed.
    – mwfearnley
    Aug 14, 2016 at 14:44
  • How long does the insmod normal command take? After pressing Enter my ubuntu hangs. Admittedly it's 'running' as a VM in Oracle VirtualBox though.
    – snark
    Nov 9, 2017 at 13:13
  • 1
    Update: It came back eventually with error: failure reading sector 0x8019a4 from 'hd0' so I guess it's pretty terminal!
    – snark
    Nov 9, 2017 at 13:24
  • 1
    note that the prefix will depend on the disk layout - e.g. a modern system with a seperate /boot may have something like set prefix=(hd0,msdos5)/grub2
    – Wilf
    Aug 15, 2018 at 1:52

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 ...

  • 3
    I cannot find any boot folder at the root level in the BusyBox
    – isnvi23h4
    Sep 20, 2016 at 9:51
  • 1
    The vmlinuz,... boot images you are looking for could be in the top-level root filesystem so try using just a slash. That will also show top-level directories. If the boot images are not in the top-level root, you can start trying the most promising of the directories till you find them. For example: ls (hd0,1)/, ls (hd0,2)/, ls (hd0,2)/initramfs/, etc.. Sep 21, 2016 at 5:48
  • In my case, after running ls (hd0,7)/boot, it shows attempt to read or write outside of disk 'hd0'.
    – d a i s y
    Nov 17, 2016 at 5:19
  • 1
    I had to set the prefix to /boot/grub before being allowed to run insmod linux!
    – Emil
    Feb 6, 2017 at 15:32
  • 1
    Cant find any boot folder cd /boot/. When trying / it says permission denied. Jul 12, 2020 at 5:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.