GRUB-UFI Booting Windows


What GRUB 2 EFI grub.cfg entry do I need to be able to boot Windows on the first hard drive while Linux is installed on the second?

Linux is on /dev/sdb5
Windows system is /dev/sda1
Windows C: drive is /dev/sda2

Any pointers would be greatly appreciated.

I would have a look here: openSUSE:UEFI - openSUSE Wiki

I don’t think a MBR booting of openSUSE can select an EFI install of Windows from a Grub 2 menu. The EFI boot must be selected from your PC UEFI setup and not from Grub 2. I have decided myself to stick with all MBR boot disks which allows you to select Windows and does not keep you from using a UEFI disk for the purpose of exceeding the 2.2 TB disk size MBR limit. For more info on disks, have a look here:

Creating Partitions During Install for MBR and GPT Hard Disks - Blogs - openSUSE Forums

Thank You,

And your openSUSE version is … ?

If you are using opensuse 12.3, then there should already be a grub menu entry unless you disabled os-prober when setting up grub2-efi.

On a freshly installed 12.3, that menu won’t actually work unless you have disabled secure-boot. However, once you have completed online updates, include the updates to grub2-efi, it should start working.

If you have an older version of opensuse, then I’m not sure whether those updates to grub have been made available. In that case, your best bet might be to use the firmware boot selector (usually, hit F12 during boot). Or, from a root command line in linux, you can use:

# efibootmgr -n NNNN
##### in my case
##### efibootmgr -n 0

where the “NNNN” is the number of your boot entry for Windows. You can find the number with “efibootmgr -v”.

The idea is to tell you firmware which system to boot next, assuming that the firmware fully implements the efi specifications.

I’m using openSUSE 12.3 and it won’t detect my Windows. I need just a line in grub.cfg. I’ll try updating 12.3 first but I don’t think that’ll work unless you know specifically of a bug fix for this.

I’m not sure that this will do you any good. But here are the Windows lines from my “grub.cfg”

menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-960A-3282' {
        insmod part_gpt
        insmod fat
        set root='hd0,gpt1'
        if  x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  960A-3282
          search --no-floppy --fs-uuid --set=root 960A-3282
        chainloader /efi/Microsoft/Boot/bootmgfw.efi

This is with a gpt partitioned disk. The EFI partition used by Windows is “/dev/sda1”. The string “960A-3282” is the UUID of that partition (as checked with the “blkid” command). The Windows version is Windows 8, and it boots using the file “bootmgfw.efi” in the directory “/EFI/Microsoft/Boot” within the partition “/dev/sda1”.

You have not said what Windows version you are using, or whether Windows is installed to boot with UEFI or with MBR. I suspect you cannot boot a MBR installed version of windows using grub2-efi. And if your “/dev/sda” is MBR partitioned (instead of “gpt” partitioned), then you probably can’t boot Windows from grub2-efi due to Windows limitations with EFI.

I forgot to specify that I’m in Windows 7. Does that change anything with the menu entry you gave me above?


Probably. What’s the output from:

efibootmgr -v

What’s in the Microsoft directory of your EFI partition?

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0009,0002,0003
Boot0000* opensuse HD(3,e33ea000,52000,a79c0298-4944-490b-87a0-ca6b76cee4ca)File(\EFI\opensuse\grubx64.efi)
Boot0002* Hard Drive BIOS(2,0,00)AMGOAMNOo…-.H.i.t.a.c.h.i. .H.D.S.…A…AMBOAMNOe…-.S.T.…A…AMBO
Boot0003* Network Card BIOS(6,0,00)AMGOAMNOd….R.e.a.l.t.e.k. .P.X.E. .B.0.6. .D.0.0…rN.D+…,…AMBO
CD/DVD Drive BIOS(3,0,00)AMGOAMNOq…-.h.p. . . . . . .D.V.D. .R.W. .A.D.-.…A…AMBO

ls -la /boot/efi/EFI output:
total 24
drwxrwxr-x 3 root root 4096 Jun 28 09:07 .
drwxrwxr-x 3 root root 16384 Dec 31 1969 …
drwxrwxr-x 2 root root 4096 Jun 28 09:07 opensuse


I guess I really wanted to know what’s in the EFI partition of “/dev/sda” (if it has an EFI partition).

What’s the output from:

# fdisk -l /dev/sda
# gdisk -l /dev/sda

And please use code tags for that output. You can get code tags by clicking the “#” button on the edit screen.