Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an HP ProBook 5330m with SSD, without CD, and Windows 7. I also installed ubuntu 12.10 and have been dual booting for many months now. Something went wrong and now I can't boot my laptop at all!

The error message is

error: invalid arch independent ELF magic.
grub rescue>

Another problem is that I cannot boot from USB! I tried to create usb startup disks - ubuntu live CD, supergrub, ... but when I configure the USB as first boot sequence, I get the error:

Remove disks or other media.
Press any key to restart

So, I'm really stuck. Any suggestions? How can I recover my system with the grub rescue shell?

share|improve this question

Boot into Live CD and run:

sudo mount /dev/sdaX /mnt
sudo grub-install --root-directory=/mnt /dev/sda


sdaX-->Here X stands for the partition where you have installed /. If its installed in sda2 then you need to run sudo mount /dev/sda2 /mnt

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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