LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-07-2012, 02:23 AM   #1
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 15.0 (multilib)
Posts: 1,350

Rep: Reputation: 75
Set up Windows as boot option in Grub2


I have an UEFI/GPT system with Grub2 booting Slackware on sda and UEFI/GPT booting Windows on sdb.

I want to add Windows to the gub list as it was not added automatically.

I have seen this

Quote:
(Find the UUID of the FAT32 filesystem in the UEFI SYSTEM PARTITION where the Windows UEFI Bootloader files reside. For example, if Windows bootmgfw.efi exists at /boot/efi/efi/Microsoft/Boot/bootmgfw.efi (ignore the upper-lower case differences since that is immaterial in FAT fs):
# grub-probe --target=fs_uuid /boot/efi/efi/Microsoft/Boot/bootmgfw.efi
1ce5-7f28
Then, add this code to grub.cfg to chainload Windows x86_64 (Vista SP1+, 7 or 8) installed in UEFI-GPT mode :
menuentry "Windows x86_64 UEFI-GPT" {
search --fs-uuid --no-floppy --set=root 1ce5-7f28
chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
So I tried mounting the small FAT partition containing efi/Microsoft/Boot/bootmgfw.efi and
managed to get out a code. But this would not boot and I had an error - unrecognised code.

I have also seen this

Quote:
Chainload Microsoft Windows x86_64 UEFI-GPT Find the UUID of the FAT32 filesystem in the UEFI SYSTEM PARTITION where the Windows UEFI Bootloader files reside. For example, if Windows bootmgfw.efi exists at /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi (ignore the upper-lower case differences since that is immaterial in FAT filesystem):

# grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
1ce5-7f28
# grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
--hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1
Then, add this code to /boot/grub/grub.cfg OR /boot/efi/EFI/grub/grub.cfg to chainload Windows x86_64 (Vista SP1+, 7 or 8) installed in UEFI-GPT mode:

menuentry "Microsoft Windows x86_64 UEFI-GPT" {
insmod part_gpt
insmod fat
insmod search_fs_uuid
insmod chain
search --fs-uuid --no-floppy --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 1ce5-7f28
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
but grub-probe did not like the instruction # grub-probe --target=hints_string

Any ideas?

TIA
 
Old 09-07-2012, 07:21 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
The best way is to use the files in '/etc/grub.d':

Code:
[joshua:/etc/grub.d]$ ls
00_header  10_linux  20_linux_xen  20_memtest86+  30_os-prober  40_windows  41_custom  README
[joshua:/etc/grub.d]$ cat 40_windows
#!/bin/sh
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 "Microsoft Windows 7 BIOS-MBR" {
    insmod part_msdos
    insmod ntfs
    insmod search_fs_uuid
    insmod ntldr     
    search --fs-uuid --no-floppy --set=root F060B0DA60B0A92C
    ntldr /bootmgr
}
Where "F060B0DA60B0A92C" is the UUID of my windows partition.

You then just run 'sudo grub-mkconfig -o /boot/grub/grub.cfg' and it generates a grub.cfg for you.

http://en.gentoo-wiki.com/wiki/Grub2..._Windows_Entry and https://wiki.archlinux.org/index.php...tiboot_in_BIOS both cover the issue, though I think Arch uses a newer version (because it says you don't have to chainload, like in my config, whereas gentoo doesn't say that).

Hope this helps,
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Editing Default GRUB2 Boot Entry from Windows newmanium2001 Linux - Software 2 04-01-2012 11:25 AM
grub2 can not boot windows 7 jtrol Slackware 1 12-10-2010 04:50 AM
[SOLVED] Multi-boot grub2 destroyed on windows 7 reboot hhoyt Linux - Software 5 08-17-2010 03:01 PM
restoring ubuntu in boot option in multi-boot set up. avee137 Linux - Newbie 4 05-07-2010 01:42 AM
[SOLVED] How to get Grub2 to boot OS X with Graphics Mode boot option PaulFXH Linux - General 3 04-17-2010 03:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration