Announcement

Collapse
No announcement yet.

From Grub to Windows Boot Manager stoped working

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    From Grub to Windows Boot Manager stoped working

    Hello,

    upgraded from 20.10 to 21.04 successfully today, and the things inside of Kubuntu that I have already tested are working so far.

    Unfortunately now i am unable to easily switch back to Windows (10 and 8.1 on a second SSD)
    Selecting "Windows Boot Manager (on /dev/nvme1n1p1)" ends stuck at the Windows logo with no running circle below.

    Code:
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry 'Windows Boot Manager (auf /dev/nvme1n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-DAA0-AB8B' {
     insmod part_gpt
     insmod fat
     if [ x$feature_platform_search_hint = xy ]; then
       search --no-floppy --fs-uuid --set=root  DAA0-AB8B
     else
       search --no-floppy --fs-uuid --set=root DAA0-AB8B
     fi
     chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    }
    set timeout_style=menu
    if [ "${timeout}" = 0 ]; then
    set timeout=10
    fi
    ### END /etc/grub.d/30_os-prober ###
    If i go to the bios settings instead (or select "UEFI Firmware Settings" which also goes to the bios settings) and select to start the UEFI "Windows Boot Manager" entry directly from bios, basically skipping Grub, the Windows boot Manager starts without any problems.

    #2
    Found the reason / a workaround.

    I have Jetico BestCrppt Volume Encryption installed on my Windows 10, not encrypted the windows drive itself just for some encrypted USB Hard drives i am working with.
    It replaced the /EFI/Microsoft/Boot/bootmgfw.efi file with its own little (pre)bootloader, renamed and probably kinda chainloads the Microsoft one as "bootmgfw__.efi".
    Worked with Kubuntu 20.10 without problems but for some unknown reason not with 21.04. If i change the grub config to directly load "bootmgfw__.efi" it works.
    Next i have to take a closer look how the /etc/grub.d/ Config files work to make my changes update resistant.

    Comment


      #3
      Originally posted by midimax View Post
      ... to make my changes update resistant.
      IMO the best way to do this is to turn off the grub updates altogether, and manually maintain a simplified grub.cfg, independent of any particular install.

      The easiest might be to drop a file called custom.cfg in the /boot/grub directory, that has grub menu entries.
      Regards, John Little

      Comment


        #4
        Originally posted by jlittle View Post
        ... turn off the grub updates altogether, and manually maintain a simplified grub.cfg ...
        Wouldn't that mean I have to manually update grub.cfg after every Kernel update?

        Anyway, I have now a "29_os-windows" in the /etc/grub.d directory
        Code:
        #!/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 'Windows Boot Manager (on /dev/nvme1n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-DAA0-AB8B' {
        # remove custom background image because the loading windows circle within the background image looks weird
           background_image
           clear
        # load my Windows Boot Manager
           insmod part_gpt
           insmod chain
           insmod fat
           if [ x$feature_platform_search_hint = xy ]; then
             search --no-floppy --fs-uuid --set=root  DAA0-AB8B
           else
             search --no-floppy --fs-uuid --set=root DAA0-AB8B
           fi
           chainloader /EFI/Microsoft/Boot/bootmgfw__.efi
        }
        this should theoretically never be overwritten by any update, and I changed "30_os-prober" to non-executable.
        Worst case, a (new) "30_os-prober" script update gets executable again, there will be 2 "Windows Boot Manager..." Lines and the first one is mine.

        Comment


          #5
          Originally posted by midimax View Post
          Wouldn't that mean I have to manually update grub.cfg after every Kernel update?
          No, APT maintains symbolic links to the latest kernel and initrd.img. I go for years sometimes without having to change grub.cfg. For example, here is a minimal grub.cfg, booting Kubuntu from a subvolume named "@r" in a btrfs labelled "main":
          Code:
          insmod part_gpt
          insmod btrfs
          insmod all_video
          insmod part_msdos
          
          set timeout=5
          
          menuentry 'Kubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
            search --no-floppy --set=root --label "main"
            linux /@r/boot/vmlinuz root=LABEL=main ro rootflags=subvol=@r
            initrd /@r/boot/initrd.img
          }
          menuentry 'extras' {
            search --no-floppy --set=root --label "main"
            configfile /@r/boot/grub/grub.cfg
          }
          (That last extra bit is there to get recovery mode, a previous kernel, and anything else grub might generate, just in case. In about 12 years doing this, I needed the extras once, when Ubuntu moved the links.)

          If I have another install, I manually clone the Kubuntu entry and adjust it; IMO it's easy to do so in such a readable form.
          Regards, John Little

          Comment

          Working...
          X