• Grub menu will not allow entry to laptop recovery mdoe


    Hi antegros community,
    I was dualbooting Windows 10 and Lubuntu on my HP ProBook 430 G3. I have decided to switch from Lubuntu to Antegros so I have installed the Antegros and updated my efi partition.

    I want to run Windows recovery because it seems that Windows boot was somehow corrupted during Antegros install. I had to set up boot delay to 5 seconds to be able to enter BIOS (F10) because the Grub would flash over before the BIOS would load.

    When I try to enter boot menu (Esc) or HP Recovery mode (F11) it will start loading but before the loading of Boot menu or recovery mode finishes the GRUB menu will flash over. I have tried to enter the GRUB command line and type “exit” which would previously show me the BIOS menu where I can choose the recovery mode. The recovery mode would not load and it would just display GRUB menu again.

    I have tried Fedora, Zorin, and Lubuntu and I have never encountering any similar issues. With Lubuntu and Zorin I had secure boot enabled with Fedora and Antegros I have disabled it.

    I have concluded that Windows 10 boot might be corrupted because following was not successful:

    • running os-prober (no results)
    • grub update
    • grub mkconfig and reinstalling grub as described here How To Fix Grub With EFI Boot?
    • manually adding the efi grub entry to /etc/grub.d/40_custom. This makes the entry visible but nothing happens when I select it.

    Please let me know what logs should I provide.

  • Looks like I cannot edit the post, it will always show “Connection to antegros community lost” error message.

    So here are some logs and settings for the start:

    my /etc/grub.d/40_custom:

    #!/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.
    if [ "${grub_platform}" == "efi" ]; then
    	menuentry "Windows 10 64-bit UEFI-GPT" {
    		insmod part_gpt
    		insmod fat
    		insmod search_fs_uuid
    		insmod chain
    		search --fs-uuid --set=root $hints_string $fs_uuid
    		chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    	}
    fi
    
    

    result of fdisk -l:

    Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: gpt
    Disk identifier: -------------------------------------
    
    Device          Start        End   Sectors   Size Type
    /dev/sda14  962799616 1707433983 744634368 355.1G Microsoft basic data
    /dev/sda17 1912236032 1914243071   2007040   980M Windows recovery environment
    /dev/sda18 1914243072 1949319167  35076096  16.7G Microsoft basic data
    /dev/sda19 1949319168 1953513471   4194304     2G Microsoft basic data
    
    
    Disk /dev/sdb: 232.9 GiB, 250059350016 bytes, 488397168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: -----------------------------------
    
    Device         Start       End   Sectors   Size Type
    /dev/sdb1       2048   1023999   1021952   499M Windows recovery environment
    /dev/sdb2    1024000   1228799    204800   100M EFI System
    /dev/sdb3    1228800   1261567     32768    16M Microsoft reserved
    /dev/sdb4    1261568 295094942 293833375 140.1G Microsoft basic data
    /dev/sdb5  295096320 296959999   1863680   910M Windows recovery environment
    /dev/sdb6  296960000 300592811   3632812   1.7G Linux filesystem
    /dev/sdb7  300592812 488397134 187804323  89.6G Linux filesystem
    
  • @ayhomaru
    Maybe this thread could interest you: https://forum.antergos.com/topic/9039/grub-boot-examples-custom-cfg

    Especially this stuff:

    menuentry "Windows 10" {
      savedefault
      set file=/EFI/Microsoft/Boot/bootmgfw.efi
      insmod fat
      search --set --file $file
      chainloader $file
    }
    

    But you have Windows stuff on two disks, which one (which partition) contains the recovery you want to boot?

    And could you please also give the output of:

    lsblk -fm
    
  • @manuel Hi manuel, thanks a lot for reply, I was getting really hopeless. Here is the result of lsblk:

    [[email protected] ~]$ lsblk -fm
    NAME FSTYPE LABEL UUID                                 MOUNTPOINT   SIZE OWNER GROUP MODE
    sda                                                               931.5G root  disk  brw-rw----
    ├─sda14
    │    ntfs   DATA  9CA8B162A8B13C18                                355.1G root  disk  brw-rw----
    ├─sda17
    │    ntfs         D8A8FFA5A8FF7FF4                                  980M root  disk  brw-rw----
    ├─sda18
    │    ntfs   Recovery Image
    │                 DE76419A76417475                                 16.7G root  disk  brw-rw----
    └─sda19
         vfat   HP_TOOLS
                      CC29-E2C6                                           2G root  disk  brw-rw----
    sdb                                                               232.9G root  disk  brw-rw----
    ├─sdb1
    │    ntfs   Obnovení
    │                 C016C40E16C406FE                                  499M root  disk  brw-rw----
    ├─sdb2
    │    vfat         D1C2-3A9A                            /boot/efi    100M root  disk  brw-rw----
    ├─sdb3
    │                                                                    16M root  disk  brw-rw----
    ├─sdb4
    │    ntfs         7C8CCC608CCC1714                                140.1G root  disk  brw-rw----
    ├─sdb5
    │    ntfs         0A4CD39A4CD37EBF                                  910M root  disk  brw-rw----
    ├─sdb6
    │    swap         b393980b-a6c2-4dd0-8819-821283456b3d [SWAP]       1.7G root  disk  brw-rw----
    └─sdb7
         ext4         91ff1c2a-835f-4723-a704-e56a5bba7e53 /           89.6G root  disk  brw-rw----
    
    

    I want to boot Windows installed at sdb4 the boot EFI partition is sdb2. The HDD sda has no boot efi partitions I use it just for data backup. I will try your example, but what is exactly represented by the variable $file, where does it get its value from?

  • @ayhomaru
    The $file variable gets the value on the set file=… line. :)
    The the search line finds on which partition the actual file is.

    But could you show what this command displays:

    find /boot/efi -iname \*.efi -exec ls -l {} \;
    

    It should show the *.efi files including the Windows .efi file, if it exists.

  • Yes, thanks. I realized it some time later in the end 😊

    Here it is:

    [[email protected] ~]$ find /boot/efi -iname \*.efi -exec ls -l {} \;
    -rwxr-xr-x 1 root root 122880 Jul 28 16:17 /boot/efi/EFI/antergos_grub/grubx64.efi
    total 120
    -rwxr-xr-x 1 root root 122880 Jul 25 21:27 grubx64.efi
    -rwxr-xr-x 1 root root 122880 Jul 25 21:27 /boot/efi/EFI/BOOT/BOOTX64.efi/grubx64.efi
    total 120
    -rwxr-xr-x 1 root root 122880 Jul 25 21:27 grubx64.efi
    -rwxr-xr-x 1 root root 122880 Jul 25 21:27 /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi/grubx64.efi
    -rwxr-xr-x 1 root root 122880 Jul 27 23:18 /boot/efi/EFI/antergos/grubx64.efi
    
    
  • I have tried to repair the windows EFI partition. Antegros installed somehow unassigned the letter for the drive so I fixed it and ran following commands the windows recovery command prompt:

    bootrec /fixboot
    bootrec /rebuildBcd
    

    After that the boot via grub was still not possible.

    I have also updated the GRUB entry as you suggested, now I get different error:

    grub error: no such device /EFI/Microsoft/Boot/bootmgfw.efi
    

    But when I ran grub-mkconfig the config was rebuild and one additional entry named Windows on /dev/sdb2 (my efi partition) was generated. When I try to run this entry it says:

    grub error: not a regular file
    

    However after the EFI fix by using windows install USB the os-prober is now able to detect the Windows installation:

    [[email protected] ~]$ sudo os-prober
    /dev/[email protected]/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
    
  • @ayhomaru
    The find command shows that the Microsoft efi file /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi is somehow overwritten by Antergos efi file. That shouldn’t have happened in normal install.

    The only grub efi file that I have is /boot/efi/EFI/antergos_grub/grubx64.efi. The others you have may be remains from other installations?

    So you need to fix the Windows efi files with some Windows installer disk, and seems that you already tried that.
    After fixing Windows efi files you need to run command

    sudo grub-mkconfig -o /boot/grub/grub.cfg
    

    again.

    Does the same find command now show any difference?

  • @manuel

    Thank you, everything works now! Here is what I did step by step based on your advice, maybe it can be useful for someone else as well:
    /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi was actually a folder so I have completely removed it:

    sudo rm -r /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
    

    Then I started the windows console from the Windows USB recovery and ran following commands:
    first diskaprt to list volumes and their letter. This command will launch the diskpart command line app:

    diskpart
    

    then

    list volume
    

    Volume 6 of my SSD drive (/dev/sdb/) was EFI partition, it usually has 100 MB and no disk letter (C: , B: etc) assigned to it. So I select volume 6:

    sel vol 6
    

    I have assigned the letter to the EFI partition so that I can switch to it:

    assign letter=b
    

    then type b: to switch to the EFI partition.

    I was not allowed to run bootrec /fixboot right away, it said “No permission”. I tried to switch to the B:boot/efi folder but that did not help. Then I stumbled upon this guide on Google: 2 Methods to Restore/Repair Deleted EFI Boot Partition in Windows 10/8/7

    I typed exit to exit the diskpart, and then run following command (directly in the command line):

    bcdboot X:\windows Note
    

    Where X is the letter of the volume where your windows is, it is NOT the letter of the EFI partition! This command will copy the efi files from the windows drive tot the efi partition. If everything is ok it will say “Boot files completed successfully”. When the command finished I saw correct windows grub files in the directory /boot/efi/EFI/Microsoft/Boot/

    After restart, I have just changed the boot order in the UEFI BIOS because after this fix the Windows bootloader was first so the grub menu did not show up, it just booted Windows 10 right away.
    /boot/efi/EFI/Microsoft/Boot/

    Here is my efi files structure:

    [[email protected] efi]$ find /boot/efi -iname \*.efi -exec ls -l {} \;
    -rwxr-xr-x 1 root root 122880 Jul 28 16:17 /boot/efi/EFI/antergos_grub/grubx64.efi
    -rwxr-xr-x 1 root root 122880 Jul 25 21:27 /boot/efi/EFI/BOOT/bootx64.efi.{03892591-a672-4566-ab70-78071c822ffd}/grubx64.efi
    -rwxr-xr-x 1 root root 1273760 Jun  8 14:53 /boot/efi/EFI/BOOT/bootx64.efi
    -rwxr-xr-x 1 root root 1273760 Jun  8 14:53 /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
    -rwxr-xr-x 1 root root 1257376 Jun  8 14:52 /boot/efi/EFI/Microsoft/Boot/bootmgr.efi
    -rwxr-xr-x 1 root root 1103776 Jun  8 14:20 /boot/efi/EFI/Microsoft/Boot/memtest.efi
    -rwxr-xr-x 1 root root 122880 Jul 27 23:18 /boot/efi/EFI/antergos/grubx64.efi
    
    

    When I switched back to Antergos and ran

    sudo grub-mkconfig -o /boot/grub/grub.cfg
    

    The windows 10 entry was automaticall added to grub,

grub111 bios19 efi16 boot-problems4 Posts 9Views 295
Bloom Email Optin Plugin

Looks like your connection to Antergos Community Forum was lost, please wait while we try to reconnect.