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 have a dell inspiron 5520. I had installed windows 8 and have ubuntu 12.04 installed in a different partition. I installed grub but it was not showing windows 8. So i added

menuentry "Windows 8" {

set root = "(hd0,4)"

  chainloader +1

  }

in /etc/grub.d/40_custom. Now, I see Windows 8 option but it says error-invalid selection when I select it. Please help.

This is the output of fdisk -l:

/dev/sda1 * 16072 626807 305368 de Dell Utility
/dev/sda3 7645184 500201471 246278144 7 HPFS/NTFS/exFAT
/dev/sda4 500203518 976771071 238283777 f W95 Ext'd (LBA)
Partition 4 does not start on physical sector boundary.
/dev/sda5 500203520 870275071 185035776 7 HPFS/NTFS/exFAT
/dev/sda6 870277120 886276095 7999488 82 Linux swap / Solaris
/dev/sda7 886278144 976771071 45246464 83 Linux
share|improve this question

1 Answer 1

Please notice that grub's hd numbering starts with 0! In your case:

/dev/sda1 is (hd0,0)
/dev/sda3 is (hd0,1)
/dev/sda4 is (hd0,2)
/dev/sda5 is (hd0,3)
/dev/sda6 is (hd0,4)
/dev/sda7 is (hd0,5)

As you can see, you are trying to chainload the swap partition! Choose the correct partition's setting, and it will work.

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.