Fedora Linux Support Community & Resources Center
  #1  
Old 15th March 2017, 05:30 PM
mvandemar Offline
Registered User
 
Join Date: Nov 2013
Location: Largo, FL
Posts: 63
linuxfedorafirefox
How can I edit the Windows menu entry in grub2?

I just installed Fedora 25 on a laptop dual booting with Windows 8.1 using uefi. Unfortunately out of the box it will not allow Windows to boot, and I need to edit the last line in the boot menu from:

Code:
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
to be

Code:
chainloader (hd0,2)/EFI/Microsoft/Boot/bootmgfw.efi
However, I cannot for the life of me figure out how to do that. From what I read I need to either use grubby, which looks like it is just for editing linux entries, or edit /etc/grub.d/30_os-prober, which is a script and not a config file. Anyone know how to accomplish this? Thanks.

-Michael
Reply With Quote
  #2  
Old 15th March 2017, 07:05 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,559
linuxchrome
Re: How can I edit the Windows menu entry in grub2?

I would ask first, have you done a "# dnf upgrade" on your new F25 install. If not, do so now.

After that, do:
Code:
# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
That will generate a new grub.cfg file. It could potentially alter the Windows 8.1 entry, making it functional.

FYI: The grub2-mkconfig command will parse information from the /etc/default/grub file, and also run all the scripts in /etc/grub.d/, including the 30_os-prober script which is the one responsible for detecting other OS's within the system.

Report results and we can work from there if things are still not fixed.

Last edited by PabloTwo; 15th March 2017 at 07:28 PM. Reason: Ooops! No "dnf" in front of that command.
Reply With Quote
  #3  
Old 15th March 2017, 07:12 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,559
linuxchrome
Re: How can I edit the Windows menu entry in grub2?

I have a working F25/W8 dual-boot in UEFI. The working grub.cfg menu entry for W8 has:

chainloader /EFI/Microsoft/Boot/bootmgfw.efi

But what directs it to the correct ESP partition is this line in the menu:

set root='hd0,gpt2'

So adding the "(hd0,2)" part would be incorrect, as it's not proper gpt partitioning format.

Edit: DO NOT edit the 30_os-prober file.

Last edited by PabloTwo; 15th March 2017 at 07:27 PM.
Reply With Quote
  #4  
Old 15th March 2017, 07:22 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,559
linuxchrome
Re: How can I edit the Windows menu entry in grub2?

Just a FYI: The grub2-mkconfig command will parse info from the /etc/default/grub file and also run all the script files in /etc/grub.d/ directory, including the 30_os-prober script, which is responsible for detecting other OS's on the system.

It's possible to disable os-prober with an entry in the /etc/default/grub file and also to manually create a new menu entry by adding the proper menu items into the 40_custom script file. I don't believe you will need to do either of the above, but say this just so you'll know.
Reply With Quote
  #5  
Old 15th March 2017, 10:33 PM
mvandemar Offline
Registered User
 
Join Date: Nov 2013
Location: Largo, FL
Posts: 63
linuxfedorafirefox
Re: How can I edit the Windows menu entry in grub2?

Quote:
Originally Posted by PabloTwo View Post
I would ask first, have you done a "# dnf upgrade" on your new F25 install. If not, do so now.
Technically it was an F24 install, since I was trial and erroring things, and that was what was installed when I thought to edit the menu item manually. This was after 6 or so from scratch restoring the laptop and then installing Fedora attempts. F22 worked out of the box, but then it wouldn't let me upgrade to F25.

Quote:
Originally Posted by PabloTwo View Post
Edit: DO NOT edit the 30_os-prober file.
Too late. I did edit that, adding the (hd0,2) inside the first conditional that echo'd out "chainloader", then re-ran grub2-mkconfig, and this did add the entry in the correct location, and now the machine does dual boot. However, I know this is a hack and the wrong way to do it, because now if there ever were another os to detect it would (incorrectly) add the same parameter to that as well. While I know this is highly unlikely, I would like to get it working the way it is supposed to at some point. However, it's my assistant's laptop, and she has left for the day, so I won't be able to try anything else until tomorrow.

Quote:
Originally Posted by PabloTwo View Post
I have a working F25/W8 dual-boot in UEFI. The working grub.cfg menu entry for W8 has:

chainloader /EFI/Microsoft/Boot/bootmgfw.efi

But what directs it to the correct ESP partition is this line in the menu:

set root='hd0,gpt2'

So adding the "(hd0,2)" part would be incorrect, as it's not proper gpt partitioning format.
I believe that root= line was in there already, but again I can't check until tomorrow. My biggest issue, I think, is that I couldn't figure out how to target the Windows menu item with grubby, which is supposedly the official way to make those changes. The docs show how to target specific kernels, but they all assume that they are linux and I didn't see anything about how to edit the Windows launch options.

-Michael
Reply With Quote
  #6  
Old 17th March 2017, 09:32 PM
mvandemar Offline
Registered User
 
Join Date: Nov 2013
Location: Largo, FL
Posts: 63
linuxfedorafirefox
Re: How can I edit the Windows menu entry in grub2?

So, we just upgraded Fedora to 25 from 24, and it looks like it overwrote the customization I put in there, but it also looks like now it is working without it. My guess is that your suggestion that running the updates might fix the issue could have been correct, since we updated everything before running the upgrade. I can't know for sure without starting over though, and there's no way I am doing that all again just for a test.

Thank you again for your help.

-Michael
Reply With Quote
  #7  
Old 18th March 2017, 12:20 AM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,559
linuxchrome
Re: How can I edit the Windows menu entry in grub2?

Quote:
Originally Posted by mvandemar
I just installed Fedora 25 on a laptop dual booting with Windows 8.1 using uefi. Unfortunately out of the box it will not allow Windows to boot
Quote:
Originally Posted by PabloTwo
have you done a "# dnf upgrade" on your new F25 install.
Quote:
Originally Posted by mvandemar
Technically it was an F24 install, since I was trial and erroring things, and that was what was installed when I thought to edit the menu item manually.
Yeah, so your asking for help here on F25 which in reality is actually F24. Is that right?
Quote:
Originally Posted by mvandemar
So, we just upgraded Fedora to 25 from 24, and it looks like it overwrote the customization I put in there, but it also looks like now it is working without it.
Had I known that from the start, I probably would have mentioned to you that I had no luck at getting my HP laptop grub2 menu entry for W8 to work (actually boot Windows) until I upgraded to F25. It's also why I suggested to be sure your F25 system was fully updated at the time.

In any event, I'm glad it's working for you now.
Reply With Quote
  #8  
Old 18th March 2017, 05:04 AM
mvandemar Offline
Registered User
 
Join Date: Nov 2013
Location: Largo, FL
Posts: 63
linuxfedorafirefox
Re: How can I edit the Windows menu entry in grub2?

Quote:
Originally Posted by PabloTwo View Post
Yeah, so your asking for help here on F25 which in reality is actually F24. Is that right?
I was asking about an issue that happened regardless of whether or not it was 24 or 25. I installed 25 I think 3 times trying to fix it, because at first I thought it might be due to the way I was burning the usb, or because I resized the Windows partition, but then didn't fully log out and then back into Windows again before installing Fedora. I know now it wasn't either of those, but like I said, it was trial and error. I happened to be in 24 when I finally thought to edit the menu entry.

Quote:
Originally Posted by PabloTwo View Post
Had I known that from the start, I probably would have mentioned to you that I had no luck at getting my HP laptop grub2 menu entry for W8 to work (actually boot Windows) until I upgraded to F25. It's also why I suggested to be sure your F25 system was fully updated at the time.

In any event, I'm glad it's working for you now.
Yeah, I don't know what exactly fixed it, but now it's working without any edits thankfully.

-Michael
Reply With Quote
  #9  
Old 18th March 2017, 03:59 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,559
linuxchrome
Re: How can I edit the Windows menu entry in grub2?

Quote:
Originally Posted by mvandemar
Yeah, I don't know what exactly fixed it, but now it's working without any edits thankfully.
My first thought would be that F25 had a newer version of grub2 than what was available in F24. But after checking on the koji build server, that suspicion was quickly dispelled, as the most recent release (grub2-2.02-0.38.fc25.x86_64} was built for and pushed to F24 at the same time. The build includes, among others, the grub2-tools sub-package, which provides the /etc/grub.d/ scripts.

So what the difference was will probably remain a mystery.
Reply With Quote
Reply

Tags
edit, entry, grub2, menu, windows

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Hide MS-Windows Recovery partition in Grub2 boot menu samster Installation, Upgrades and Live Media 4 11th March 2015 04:53 PM
Creating custom menu entry for dual boot fedora 19 and windows 8 glennpl Using Fedora 0 11th October 2013 03:17 PM
[SOLVED] Windows 8 not in grub2 menu icee3x3 Installation, Upgrades and Live Media 23 6th January 2013 03:38 AM
Windows 7 not in Grub2 menu JuliusV Installation, Upgrades and Live Media 6 5th January 2013 06:34 PM
How do i remove the default GRUB2 menu entry for Windows? Browser Using Fedora 3 21st March 2012 09:32 AM


Current GMT-time: 13:40 (Friday, 23-06-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat