I have a laptop, with installations of Ubuntu 12.10, and Windows 8. Windows 8 was first installed on the system, and Ubuntu was installed afterwards.

During the Ubuntu installation, the installer recognized that there are existing partitions, but failed to see any OS on them. I created another ext4 partition in the free space, and installed Ubuntu. Initially grub only added the entry for Ubuntu, and Ubuntu works ok.

Now I wanted to enter w8 settings to Grub manually, and modified /etc/grub.d/40_custom:

exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Windows 8" {
    insmod part_gpt
    insmod fat
    insmod search_fs_uuid
    insmod chain
    #set root='(hd0,gpt1)'
    search --fs_uuid --no-floppy --set=root --hint-bios=hd0,gpt2 --hint efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2
    chainloader /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

The search string (second to last) I found with this command: sudo grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

Now after updating grub config, rebooting and selecting windows 8 entry, it complains:

error: unspecified search type
error: file '/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi' not found

Press any key to continue

In Ubuntu however, if I do ls /boot/efi/EFI/Microsoft/Boot/b*



Now, if I press e to edit the Windows 8 entry, and then select F2 to enter grub shell, indeed if I try to run ls /boot/efi, no files are shown.

Funnily enough, if at this point I just type exit, windows 8 will boot up.

fdisk -l gives me that it recognizes /dev/sda1 as GPT partition

Any ideas what I should do to get grub working "right out of the menu"?

  • Can you provide the menuentry block for Ubuntu itself? I believe that setting the root in the Windows entry to the same of Ubuntu's will resolve the issue.
    – aularon
    Feb 2, 2014 at 21:45

4 Answers 4


Have a look at refind, it's pretty useful and slick (and does boot win8 in my tests performed while adding UEFI support to ALT Linux).

It's not a boot loader but rather a boot manager so it will allow you to choose between WBM and GRUB with both being able to actually chainload the (in)appropriate kernel.


You need to supply the UUID of the SYSTEM device on your search line (at the end). And remove the --bios tag, since you're using EFI to boot.

To find the UUID, execute the following:

sudo grub-probe  --target=fs_UUID /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
  • Hi Doug, thanks for your suggestion, I will try it once I get back home!
    – julumme
    Feb 24, 2013 at 18:08

The problem is that you are already setting your root to '(hd0,gpt1)' which I presume is (your /boot/efi directory) where your grub is.

Hence then writing /boot/efi/... is equivalent to writing /boot/efi/boot/efi... which most probably does not exist.

You should change /boot/efi/EFI/... to just /EFI/...

  • Please use a bit of formatting to facilitate reading your answer
    – ddnomad
    Jun 15, 2017 at 20:30

I currently was facing the same issue but could figure out that the cause was the wrong result of the hint grub command. Actually, it was passing me the wrong path for the .efi file.

I have two disks here and the grub was listing them as hd1 and hd2. I could figure out just using the grub command with option pressing 'c' on the grub screen and executing a ls afterwards.

It lists all the gpt partitions and the corresponding disks, since I have different partitions on both disks I could easily identify where was my efi file and then it was just a matter of changing the location of the grub entries to the correct partition where my efi file was residing in.

Notice that the chainloader path must correspond to the path without the mounting point. You can check this using the disks utility on Ubuntu !

Now I'm having just an error saying the search type is unspecified but the boot brings me the windows loader with no problem.

Regarding your question why you hit the windows loader when exiting the grub I suppose it is simple, your motherboard boot options have the windows uefi loader as the next option when grub is bypassed.

  • 1
    Answers should address the question of the original poster. This isn't meant to be like a forum. Please rephrase your answer so that it's more specific to the OP's question or delete it.
    – slm
    Feb 9, 2013 at 15:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .