Ubuntu – Repair grub on Ubuntu Virtualbox

Ubuntuvirtualbox

I've got Ubuntu 12.04.1 running as a Virtualbox on Windows 7. Ubuntu crashed (it claimed the host had too little memory, but this seems a bit odd as I have 6 Gb of ram and was only giving Ubuntu 2 Gb), so I restarted Ubuntu. However, when I did this, I got the following error:

error: ELF header smaller than expected
grub rescue>

I initially tried the solution provided at http://ubuntuforums.org/showthread.php?t=1599293 – but couldn't find the location of the iso in Step 4 (presumably because it's a VirtualBox anyway?)

When I boot from the iso, I don't get an option to repair, only boot from CD or install from scratch.

Is there a way to either:

  • boot Ubuntu from the iso and then repair the appropriate files by mounting the harddrive

or

  • install a fresh version of Ubuntu, and mount my 'old' harddrive to it so that I can recover the files

Is either option possible / better than the other one?

Best Answer

Related Question