Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I attempted to install Ubuntu alongside Windows 7. (Intel i5 2300 H67 chipset)

Unfortunately, after a seemingly successful installation I got the message:

GRUB: “invalid arch independent ELF magic” grub rescue>

Another answer here suggests I should enter these commands below, which should be customised for my own partitions.

sudo apt-get install grub-efi-amd64
sudo mount /dev/sda3 /mnt
sudo mount /dev/sda1 /mnt/boot 
sudo grub-install --root-directory=/mnt /dev/sda

My partitions are...

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   819202047   409497600    7  HPFS/NTFS/exFAT
/dev/sda3       819202048  1228802047   204800000    7  HPFS/NTFS/exFAT
/dev/sda4      1228804094  1953523711   362359809    5  Extended
/dev/sda5      1228804096  1936926719   354061312   83  Linux
/dev/sda6      1936928768  1953523711     8297472   82  Linux swap / Solaris

However, I'm a bit unsure how I can adapt those commands above because I want to be able to dual-boot with windows 7. (if those commands are appropriate for me anyway).

Given my partitions above, how can I get GRUB to give me a dual boot option?

thanks

share|improve this question

1 Answer 1

up vote 3 down vote accepted

I managed to fix this by using the live cd and entering the commands:

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

I can successfully access both Ubuntu and Windows.

share|improve this answer

Your Answer

 
discard

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.