4

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}")' { EOF 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} EOF ;; esac 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 } EOF 

but this creates:

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

Which doesn't work.

My question

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

2
  • 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*). Commented Feb 6, 2014 at 1:49
  • Consider using rEFInd as your bootloader. For more information on how it stacks up to grub, look here Commented Sep 5, 2017 at 3:47

3 Answers 3

0

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 

To:

 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.

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

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.

0

The /etc/grub.d/30_os-prober segment quoted in the OP generates a GRUB entry for Windows that boots in legacy BIOS-style.

But the working custom entry in the OP indicates the system uses UEFI-style. That means os-prober should be detecting Windows as a generic UEFI operating system. In other words, if you run os-prober as root, the result should be of the form

/dev/<ESP partition>@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi 

which should trigger the efi) case in the 30_os-prober script, not the chain) case. The resulting GRUB menu entry should be similar to:

menuentry 'Windows Boot Manager (on <ESP device>)' --class windows --class os $menuentry_id_option 'osprober-efi-<ESP UUID>' { insmod part_gpt insmod fat search --no-floppy --fs-uuid --set=root <ESP UUID> chainloader /efi/Microsoft/Boot/bootmgfw.efi } 

Given that the ESP is usually a FAT32 partition, the <ESP UUID> is usually just the FAT32 filesystem Volume Serial Number, of the form XXXX-XXXX instead of a real UUID.

Of course, given that the question is now almost 10 years old, it is possible that GRUB's 30_os-prober script did not include the efi) case yet at that time.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.