Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I did a dumb thing... I forgot that Ubuntu 10.04 (Lucid) switched to Grub2 which puts a ton of *.mod files (kernel modules) in /boot/grub. I thought they were soundtrack files put there erroneously and moved them. Needless to say, the next reboot was traumatic. I was presented with something I had no memory of ever seeing... a 'grub rescue>' prompt.

With the help of how-to-fix-error-unknown-filesystem-grub-rescue however, I was able to recover...

  • Discovered that Grub Rescue does not have 'cd', 'cp' or any other filesystem commands except its own variation of 'ls'.
  • So first I had to find the partition with the /boot directory containing vmlinuz... and other boot image files... (failed attempts not shown)

    grub rescue>  ls  
    (hd0,4) (hd0,3) (hd0,2) (hd0,1)  
     grub rescue>  ls (hd0,2)/boot
    ... grub ... initrd.img-2.6.32-33-generic ... vmlinuz-2.6.32-33-generic 
    
  • Then manually boot from 'grub rescue>' prompt (no command history either!)...

    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  
    
  • This boots and crashes to the BusyBox prompt which DOES have some rudimentary filesystem commnds.

  • Then I moved the *.mod files back to the /boot/grub directory...

    busybox>  cd /boot  
    busybox>  mv mod/* grub
    busybox>  reboot
    
  • The reboot was successful but that was a lot of work.

Is there an easier way?

share|improve this question
Boot-Repair would be way easier, in my opinion. Check out one of my multiple answers on Boot-Repair for details on using it. – SirCharlo Oct 11 '12 at 19:56

5 Answers

up vote 3 down vote accepted

No. I think you pretty much found the easiest way to recover from the state of your system using grub rescue; it is a very minimalistic system giving just enough capability to boot the system.

BTW, I believe you must have found the .mod files and executed insmod linux or the linux command would have failed.

The only other way, as mentioned, would be to boot a Live CD and reinstall grub2 after chroot'ing to the 'broken' system.

share|improve this answer
You're absolutely right! I forgot that I'd done that. Added to my original post above for future reference. I need to be more disciplined in keeping careful notes in these situations. Please advise if further edits are needed. – DocSalvage Oct 10 '12 at 5:11

General & basic help to boot errors like

GRUB loading stage 1.5 error 15 (e.g. after the installation of Windows on different disk drive)

are two commands:

sudo mount /dev/sdXY /mnt
sudo grub-install --root-directory=/mnt /dev/sdX
share|improve this answer
1  
And where can the user enter this commands? You should improve your answer. – Lucio Dec 6 '12 at 20:08
  1. Boot into Live CD

  2. Open Terminal (CTRL+ALT+T)

  3. Enter the following commands:

sudo fdisk -l

And find your Ubuntu partition (should be /dev/sda1 if it is the first partition)

sudo mount /dev/sda1 /mnt

sudo mount --bind /sys /mnt/sys

sudo mount --bind /proc /mnt/proc

sudo mount --bind /dev /mnt/dev

sudo chroot /mnt

Now reinstall Grub2

sudo apt-get install --reinstall grub2
share|improve this answer
Is this a better way better than sudo mount /dev/sda1 /mnt and sudo grub-install --root-directory=/mnt/ /dev/sda && sudo update-grub? – gkya Oct 8 '12 at 17:28

I had same problem when i did upgradation. I suggest you to follow the following simple steps: 1) Boot your system with ubuntu live CD or live USB. 2) Open the terminal and run the command sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update 3) Then install boot repair by running the command sudo apt-get install -y boot-repair && boot-repair Launch the boot repair after installing. System->Administration->Boot-Repair menu (Ubuntu 10.04 only) and follow the instruction. It will take 15-20 min to figure out the problem and to fix it. For more help go to the link https://help.ubuntu.com/community/Boot-Repair

share|improve this answer

You could boot live CD, mount your hard drive, open nautilus as root and copy those files to /boot.

share|improve this answer

protected by Community Apr 23 at 20:02

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

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