openSUSE 13.1 dual boot in EFI

Thanks a lot for a great article.

Unfortunately I’m still unable to find out how to set up my grub2 to be able to load windows 7 installation.
I’ve installed Windows 7 on the SSD after having booted from DVD in EFI mode and I’ve expected, that Win7 will perform the EFI-Installation. But after having read your article I’ve found out, that WIndows7 was installed in the MBR mode.

After WIndows installation I’ve installed Linux Mint 14 on the normal hard disk in EFI-Mode. And a boot menu of the grub2 had a working Windows7 entry.

After a while I’ve bought another SSD and installed openSuse 13.1 on it in EFI-Mode. Before having installed openSuse I’ve changed the boot priority in such a way, that the old SSD with Windows became second priority after the new empty SSD.
Unfortunately, the openSuse installer/grub2 haven’t detected Windows installation. I’m still able to select the windows installation using the EFI boot selection menu. But my wife is not so skilled.
So I’d like to setup the grub menu such a way, that I can select Windows 7 system from the grub menu.

By the way, as I tried to boot windows 7 from grub2 console, I couldn’t see the windows partitions and wasn’t able to set them as root. “insmod ntfs” hasn’t helped. The ls command shown the ssd as (hd0) without any partitions. and ls (hd0) reported “erroneous partition type” or something like this.

Could you please give me a tip how to solve this.

greetings,
Konstantin

This post has been moved and should not be connected to the previous article.

Thank You,

I’ve forgotten to tell, that using exit command in the grub2 console also makes windows 7 to be booted. But I hoped to find a better solution.

I am unsure of what problem you are having. However, here are a couple of things to understand:

  • opensuse 13.1 is not yet released. You are using a pre-release version, that has some known bugs;
  • EFI support is one of those known bugs. It does not work properly;
  • according to a note added to the bug report, the next 13.1 release (probably RC2) will revert to using the EFI support from 12.3. Presumably, that could change later (perhaps after the final release) when the problems are resolved.

Please show grub.cfg from Linux Mint. I am quite curious how they managed it.

grub.cfg from Mint 14:


#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#


### BEGIN /etc/grub.d/00_header ###
if  -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"


if  x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi


export menuentry_id_option


if  "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi


function savedefault {
  if  -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}


function recordfail {
  set recordfail=1
  if  -n "${have_grubenv}" ]; then if  -z "${boot_once}" ]; then save_env recordfail; fi; fi
}


function load_video {
  if  x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}


if  x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd1,gpt5'
if  x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5  c34af646-7973-4fa4-93a9-485a0d6fcb05
else
  search --no-floppy --fs-uuid --set=root c34af646-7973-4fa4-93a9-485a0d6fcb05
fi
    font="/usr/share/grub/unicode.pf2"
fi


if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=de_DE
  insmod gettext
fi
terminal_output gfxterm
if  "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###


### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 0,0,0; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###


### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###


### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
    if  "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
if  "${recordfail}" != 1 ]; then
  if  -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if  ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if  "${linux_gfx_mode}" != "text" ]; then load_video; fi
menuentry 'LinuxMint' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-c34af646-7973-4fa4-93a9-485a0d6fcb05' {
recordfail
    gfxmode $linux_gfx_mode
    insmod gzio
    insmod part_gpt
    insmod ext2
    set root='hd1,gpt5'
    if  x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5  c34af646-7973-4fa4-93a9-485a0d6fcb05
    else
      search --no-floppy --fs-uuid --set=root c34af646-7973-4fa4-93a9-485a0d6fcb05
    fi
    linux    /boot/vmlinuz-3.5.0-17-generic root=UUID=c34af646-7973-4fa4-93a9-485a0d6fcb05 ro   quiet splash $vt_handoff
    initrd    /boot/initrd.img-3.5.0-17-generic
}
submenu 'Advanced options for LinuxMint' $menuentry_id_option 'gnulinux-advanced-c34af646-7973-4fa4-93a9-485a0d6fcb05' {
    menuentry 'LinuxMint, with Linux 3.5.0-17-generic' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-17-generic-advanced-c34af646-7973-4fa4-93a9-485a0d6fcb05' {
    recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt5'
        if  x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5  c34af646-7973-4fa4-93a9-485a0d6fcb05
        else
          search --no-floppy --fs-uuid --set=root c34af646-7973-4fa4-93a9-485a0d6fcb05
        fi
        echo    'Loading Linux 3.5.0-17-generic ...'
        linux    /boot/vmlinuz-3.5.0-17-generic root=UUID=c34af646-7973-4fa4-93a9-485a0d6fcb05 ro   quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-3.5.0-17-generic
    }
    menuentry 'LinuxMint, with Linux 3.5.0-17-generic (recovery mode)' --class linuxmint --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-17-generic-recovery-c34af646-7973-4fa4-93a9-485a0d6fcb05' {
    recordfail
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt5'
        if  x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5  c34af646-7973-4fa4-93a9-485a0d6fcb05
        else
          search --no-floppy --fs-uuid --set=root c34af646-7973-4fa4-93a9-485a0d6fcb05
        fi
        echo    'Loading Linux 3.5.0-17-generic ...'
        linux    /boot/vmlinuz-3.5.0-17-generic root=UUID=c34af646-7973-4fa4-93a9-485a0d6fcb05 ro recovery nomodeset 
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-3.5.0-17-generic
    }
}


### END /etc/grub.d/10_linux ###


### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###


### BEGIN /etc/grub.d/20_linux_xen ###


### END /etc/grub.d/20_linux_xen ###


### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod part_gpt
    insmod ext2
    set root='hd1,gpt5'
    if  x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5  c34af646-7973-4fa4-93a9-485a0d6fcb05
    else
      search --no-floppy --fs-uuid --set=root c34af646-7973-4fa4-93a9-485a0d6fcb05
    fi
    linux16    /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_gpt
    insmod ext2
    set root='hd1,gpt5'
    if  x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5  c34af646-7973-4fa4-93a9-485a0d6fcb05
    else
      search --no-floppy --fs-uuid --set=root c34af646-7973-4fa4-93a9-485a0d6fcb05
    fi
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###


### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-8AD83414D834014D' {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos1'
    if  x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  8AD83414D834014D
    else
      search --no-floppy --fs-uuid --set=root 8AD83414D834014D
    fi
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###


### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###


### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###


### BEGIN /etc/grub.d/41_custom ###
if  -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif  -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###



I’m a kind of experienced in linux and I’m a developer:shame:. So I know what am I doing.
And I thought, that the developers of openSuse 13.1 could be pleased to have one more tester for there rc. :slight_smile:

That’s why I’m simply asking being unsure whether it is a bug or a missunderstood or failing feature.

Output of the parted command:

$sudo parted -lModell: ATA SAMSUNG SSD 830 (scsi)
Festplatte  /dev/sda:  64,0GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: msdos


Nummer  Anfang  Ende    Größe   Typ      Dateisystem  Flags
 1      1049kB  106MB   105MB   primary  ntfs         boot
 2      106MB   64,0GB  63,9GB  primary  ntfs




Modell: ATA SanDisk SDSSDHP2 (scsi)
Festplatte  /dev/sdb:  256GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: gpt


Nummer  Anfang  Ende    Größe   Dateisystem     Name     Flags
 1      1049kB  165MB   164MB   fat16           primary
 2      165MB   8751MB  8587MB  linux-swap(v1)  primary
 3      8751MB  138GB   129GB   ext4            primary
 4      138GB   256GB   118GB   ext4            primary




Modell: ATA Hitachi HUA72201 (scsi)
Festplatte  /dev/sdc:  1000GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: gpt


Nummer  Anfang  Ende    Größe   Dateisystem     Name  Flags
 1      1049kB  298MB   297MB   fat32                 boot
 2      298MB   2297MB  2000MB  linux-swap(v1)
 5      2297MB  62,3GB  60,0GB  ext4
 4      62,3GB  82,3GB  20,0GB  ext4
 3      82,3GB  1000GB  918GB   ntfs



Are you sure Mint runs in EFI mode? Your entry for Windows is MBR chainloader which cannot be performed when booted in EFI mode.

I’m not sure how to find it out, whether Linux Mint loads in EFI-Mode. At least shows Partitioner from Yast, that there is a EFI partition on the hard drive, where I’ve installed Linux Mint (see output of the parted command above - hdc1).

I have added an entry in the windows loader to load into linux Mint. If I select it, then the grub2 loader from linux mint becomes a control.
Settings dialog for bootloader during linux mint had some more options as the one of openSuse 13.1. I think it was a selection of the device where to install bootloader.
And Linux Mint haven’t added additional entry into the EFI boot menu.

I’m asking myself if it would be the best solution to add manually an entry with command like exit to the grub2 menu of openSuse, so that the EFI can fall back to the next device from the boot priority list => Windows7 bootloader in my case.

Run the command


# efibootmgr -v

If you are not in EFI mode, that will give an error message about “efivars”. If you are in EFI mode, it will give output about your BIOS boot sequence.

I found out that my Linux Mint installation boots in BIOS-Mode. (error message to the above command).

On OpenSUSE the command succeeded with following output:

# efibootmgr -vBootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0000,0003,0002
Boot0000* opensuse      HD(1,800,4e000,c175c658-959f-4850-b3c4-d9f20c2c1780)File(\EFI\opensuse\grubx64.efi)
Boot0001* Hard Drive    BIOS(2,0,00)AMGOAMNO........o.S.A.M.S.U.N.G. .S.S.D. .8.3.0. .S.e.r.i.e.s....................A...........................>..Gd-.;.A..MQ..L.0.S.2.Z.S.N.C.A.0.8.3.4.2.7. . . . . . ......AMBOAMNO........o.S.a.n.D.i.s.k. .S.D.S.S.D.H.P.2.5.6.G....................A...........................>..Gd-.;.A..MQ..L.3.1.9.2.1.8.0.4.9.1.5.1. . . . . . . . ......AMBOAMNO........o.H.i.t.a.c.h.i. .H.U.A.7.2.2.0.1.0.C.L.A.3.3.1....................A...........................>..Gd-.;.A..MQ..L.8.J.Z.3.D.P.L.5. . . . . . . . . . . . ......AMBO
Boot0002  USB   BIOS(5,0,00)AMGOAMNO.........G.e.n.e.r.i.c. .S.T.O.R.A.G.E. .D.E.V.I.C.E. .9.4.5.1....................A.............................L..Gd-.;.A..MQ..L.G.e.n.e.r.i.c. .S.T.O.R.A.G.E. .D.E.V.I.C.E. .9.4.5.1......AMBO
Boot0003* CD/DVD Drive  BIOS(3,0,00)AMGOAMNO........o.H.L.-.D.T.-.S.T. .B.D.-.R.E. . .B.H.1.0.L.S.3.8....................A...........................>..Gd-.;.A..MQ..L.9.K.C.E.K.8.1.E.2.2. .1. . . . . . . . ......AMBO
#

Can this information somehow help to solve the issue?

Normally grub loads Windows bootloader; grub2 on EFI cannot load Windows bootloader for legacy BIOS (it simply won’t work).

grub2 has direct Windows loader but for legacy BIOS only.

So what you could do at this point is to switch to legacy BIOS. It does not require reinstalling of openSUSE but you need to decide which disk is your boot disk. I would first manually install grub for BIOS, ensured that it boots and then reinstalled bootloader using yast so that system is clean.

Precise steps depend on which disk will be your boot disk.

Thanks for suggestion, but for me the following worked as needed: I’ve changed the contents of the /etc/grub.d/40_custom so that “Windows 7” entry contains only exit command and updated the grub.cfg. The appropriate part of the grub.cfg looks like this:


### BEGIN /etc/grub.d/40_custom #### 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 'Windows 7' --class windows --class os $menuentry_id_option {
        exit
}
### END /etc/grub.d/40_custom ###

The rest is done using the boot priority of the efi system.

Anyway thanks a lot for help.

Ah, nice. Yes, it is certainly possibility to simply quit grub and lest firmware to proceed.