Results 1 to 6 of 6

Thread: Manually adding a new entry (e.g. Windows) to the GRUB2-EFI boot loader menu

  1. #1

    Question Manually adding a new entry (e.g. Windows) to the GRUB2-EFI boot loader menu

    I have installed both Windows 7 and OpenSUSE 12.2 in my new laptop, which uses UEFI, GPT. I installed Windows first. Upon installing OpenSUSE, Windows did not show up in the GRUB2-EFI boot loader menu. Scouring the internet, I found two ways of adding Windows to the boot loader menu that seem to work! In both cases, I had to add lines in /etc/grub.d/40_custom, and then execute

    grub2-efi-mkconfig -o /boot/grub2-efi/grub.cfg

    The added lines for Option 1 go like this:
    menuentry "Windows 7" {
    insmod part_gpt
    insmod chain
    set root='(hd0,gpt1)'
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    }

    The lines for Option 2 go like this:
    menuentry "Windows 7" {
    insmod part_gpt
    insmod fat
    insmod search_fs_uuid
    insmod chain
    search --fs-uuid --no-floppy --set=root 080F-E6DA
    chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
    }

    where 080F-E6DA is the UUID of my ESP (/dev/sda1, mounted on /boot/efi), which I obtained using blkid.

    Since I don't really understand the menu entry lines themselves, for now my question is simple: which option is better, safer??

    (p.s. I'd like to quote commands/codes properly in these forums, but I obviously haven't figured out how to do that. Help?)

  2. #2
    Join Date
    Sep 2012
    Posts
    4,132

    Default Re: Manually adding a new entry (e.g. Windows) to the GRUB2-EFI boot loader menu

    Quote Originally Posted by untarnished View Post
    where 080F-E6DA is the UUID of my ESP (/dev/sda1, mounted on /boot/efi), which I obtained using blkid.

    Swhich option is better, safer??
    Second one is better. It makes sure grub2 will always find your partition even if move HDD around (or delete/add some more partitions). Of course, it does not necessarily mean Windows will find it as well ... so in this particular case it probably does not really matter.

    To be on safe side, use grub2-probe to obtain UUID (it should be the same but who knows ...)
    Code:
    bor@opensuse:~> sudo /usr/sbin/grub2-probe -t fs_uuid -d /dev/sda1
    1ba489f0-5772-45b7-b2ad-ad94142bd8e8
    bor@opensuse:~>

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    22,027

    Default Re: Manually adding a new entry (e.g. Windows) to the GRUB2-EFI boot loader menu

    Quote Originally Posted by untarnished View Post
    (p.s. I'd like to quote commands/codes properly in these forums, but I obviously haven't figured out how to do that. Help?)
    That is called CODE tags. You get them by using the # button in the toolbar above your post editor.
    Henk van Velden

  4. #4

    Default Re: Manually adding a new entry (e.g. Windows) to the GRUB2-EFI boot loader menu

    Quote Originally Posted by untarnished View Post

    The lines for Option 2 go like this:
    Code:
    menuentry "Windows 7" {
        insmod part_gpt
        insmod fat
        insmod search_fs_uuid
        insmod chain
        search --fs-uuid --no-floppy --set=root 080F-E6DA
        chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
    }
    where 080F-E6DA is the UUID of my ESP (/dev/sda1, mounted on /boot/efi), which I obtained using blkid.

    Since I don't really understand the menu entry lines themselves, for now my question is simple: which option is better, safer??
    That one by far! Forget about the use of partition numbers in boot entries, even with GPT. Grub will also ignore this hint if it's present and use the UUID instead.

  5. #5
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Manually adding a new entry (e.g. Windows) to the GRUB2-EFI boot loader menu

    And for what it is worth, I have found that grub2-efi does not create a working menu entry for Windows that it finds with OS Prober as there is some problem with how it works. This problem is not present in the standard grub2 it would appear.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  6. #6
    Join Date
    Jun 2008
    Location
    Stoney Stanton - England
    Posts
    1,025

    Default Re: Manually adding a new entry (e.g. Windows) to the GRUB2-EFI boot loader menu

    See thread:

    https://forums.opensuse.org/english/...win-8-a-8.html

    As it is very similiar.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •