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

After installing Ubuntu 11.10 on a pc which already has Windows 7 I get this error:

error: invalid arch independent ELF magic.
grub rescue>

So I used Supergrub boot disk to get into Ubuntu. And made sure that grub-efi-amd64 package is present, and I ran sudo grub-install /dev/sda command. That also led to the same error. Then I tried the solution given here and here. That also gave same error. fdisk -ul /dev/sda shows that boot partition (/dev/sda1) is a msdos partition. /dev/sda6 is root partition and /dev/sda9 is the home partition. So, how can I solve this issue?

share|improve this question
Please update: mark an answer accepted if it worked or edit the question to say you gave up? – Chris K Jun 19 '12 at 19:16
up vote 2 down vote accepted

It's been almost four months, but if you still need a solution, my recommendation is to switch to a different boot loader. In my experience, GRUB 2 (which Ubuntu uses by default) is the least reliable of the common EFI boot loaders for Linux. Given that you're dual-booting with Windows, you're probably best off with either Fedora's patched GRUB Legacy or a combination of ELILO and either rEFInd or rEFIt. Of these, you can do the combination of ELILO and rEFIt using Ubuntu packages, but you'll need to do some manual configuration, and Ubuntu's rEFIt package has some bugs on UEFI-based PCs. (It works better on Macs.) Thus, you'll probably have to go beyond the packaging system to manually download either GRUB Legacy or rEFInd.

share|improve this answer
Wow, finally got my new PC to work again after installing rEFInd. New Core i7, didn't even boot to windows, just using a new separate SSD with 12.04 fresh install. OEM HDD not even plugged in. This is an epic fail on Ubuntu's part. :( They should pay you for UEFI support. – Chris K Jun 19 '12 at 20:49

I had the same problem “invalid arch independent ELF magic”.

I was installing from a USB stick booted from the Bios in UEFI mode.

After a couple a couple unsuccessful reinstallation of 12.04,I tried the same installation with the the USB stick booted without the UEFI mode and it works.

For your information my setting on a 120GB SSD sda1 /windows 90 GB windows 7 64bits sda2 /boot 100 MB sda5 swap 1 GB sda6 / 18GB ubuntu 12.04 sda7 /home 8GB

My motherboard is P8P67 Pro with Asus EZbios and I had two choices in my boot menu for the USB with 12.04 installation.

Hope it helps!

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.