I'm trying to dual boot with fedora 20 and windows 8. I install first windows and then fedora. And grub detects windows automatically.

So the default \etc\grub.d\30_os-prober for windows is this:

case ${BOOT} in chain)

onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
cat << EOF
  menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
  save_default_entry | grub_add_tab
  prepare_grub_to_access_device ${DEVICE} | grub_add_tab

  case ${LONGNAME} in
    Windows\ Vista*|Windows\ 7*|Windows\ Server\ 2008*)
    cat << EOF
      drivemap -s (hd0) \${root}

  cat <<EOF
  chainloader +1

This creates this menuentry which doesn't boot windows:

What I've tried

I created in my /etc/grub.d/40_custom manually a menuentry which works fine

menuentry "Windows" {
  insmod part_gpt
  insmod fat
  insmod search_fs_uuid
  insmod chain
  search --fs-uuid --no-floppy --set=root your_UUID
  chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi

So I try to adapt this for the \etc\grub.d\30_os-prober and add replace the last part with this:

cat <<EOF
  search --fs-uuid --no-floppy --set=root $(grub_get_device_id "${DEVICE}")
  chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi

but this creates:

menuentry 'Windows Boot Manager' {
      chainloader /EFI/Microsoft/Boot/bootmgfw.efi

Which doesn't work.

My question

How should I change 30_os-prober so that it creates a working grub menuentry?

  • I don't know a ton about grub, but if I were you I would try changing Windows\ Vista*|Windows\ 7*|Windows\ Server\ 2008*) to Windows\ Vista*|Windows\ 7*|Windows\ Server\ 2008*|Windows\ 8*). Feb 6 '14 at 1:49
  • Consider using rEFInd as your bootloader. For more information on how it stacks up to grub, look here
    – evamvid
    Sep 5 '17 at 3:47

I am not that well versed with the Fedora and its Grub2. But i will share a solution i adopted in my dual-boot system with Ubuntu and Windows XP Professional Edit grub.cfg with vim or any other editor

vim /boot/grub/grub.cfg 


 121 ### BEGIN /etc/grub.d/30_os-prober ###
    122 menuentry "Microsoft Windows XP Professional (on /dev/sda1)" --class windows --class os {
    123     insmod part_msdos
    124     insmod ntfs
    125     set root='(/dev/sda,msdos1)'
    126     search --no-floppy --fs-uuid --set=root AC60CA8160CA522E
    127     drivemap -s (hd0) ${root}
    128     chainloader +1
    129 }

as the Ubuntu grub default adds this Windows as the last entry. I just added this entry in front of all other menu entries.

  • your solution look like what I do at the moment in 30_custom, but thank you anyway :D Feb 11 '14 at 14:30

Try this :-

menuentry "WINDOWS"{ set root='(hd0,msdos1)' chainloader +1 }

Change the partition number , where your windows is installed. hd0 :- means first disk msdos1 :- means first partition.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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