Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Repair a broken UEFI/GRUB2/openSUSE boot scenario

  1. #11

    Default Re: Repair a broken UEFI/GRUB2/openSUSE boot scenario

    Quote Originally Posted by susejunky View Post
    I would like to share the line of action i use to investigate and (hopefully) repair broken UEFI boot scenarios (It may even serve to manually install GRUB2 for UEFI boot).
    1. Check the GRUB2 configuration file
      Code:
      # cat /etc/default/grub | grep "GRUB_USE_LINUXEFI"
      GRUB_USE_LINUXEFI="true"
      # cat /etc/default/grub | grep "GRUB_DISABLE_OS_PROBER"
      GRUB_DISABLE_OS_PROBER="false"
      If you do not see the results shown above use an editor (e.g. vi) to change the file "/etc/default/grub"
    2. Code:
      # cat /etc/fstab | grep boot
      UUID=1234-ABCD   /boot/efi  vfat umask=0002,utf8=true  0  0
      Make sure that "1234-ABCD" fits the UUID of the EFI system partition you want to use. If there is no entry with "/boot/efi" the EFI system partition will not be mounted at system startup so you need to add an entry for the EFI system partition to "/etc/fstab".




    Regards

    susejunky

    Hi,

    That was a great info i definitely had this bookmarked. My only suggestion i repeat just a suggestion is avoid doing

    Code:
    cat file | grep pattern
    because grep does not need cat since it can parse files by itself.

    Code:
    grep --help | head -n 4
    the output would be something like below.
    Code:
    Usage: grep [OPTION]... PATTERN [FILE]...
    Search for PATTERN in each FILE or standard input.
    PATTERN is, by default, a basic regular expression (BRE).
    Example: grep -i 'hello world' menu.h main.c

    ie.
    Code:
    grep boot /etc/fstab
    Code:
    grep -E '^(GRUB_USE_LINUXEFI|GRUB_DISABLE_OS_PROBER)' /etc/default/grub
    or
    Code:
    grep -E '^(GRUB_)USE_LINUXEFI|DISABLE_OS_PROBER' /etc/default/grub
    "Unfortunately time is always against us" -- [Morpheus]

  2. #12

    Lightbulb Re: Repair a broken UEFI/GRUB2/openSUSE boot scenario

    Thanks for your great instructions!

    Although, I found when having a btrfs root filesystem it needs another mount in order to let grub2-mkconfig succeed, see below.

    Quote Originally Posted by susejunky View Post
    Code:
    # efibootmgr -b 0004 -B
    After this command the "Boot0004" entry is no longer listed. Is this expected?
    And just for my unterstanding, how do you know that "0004" is the correct entry?

    And when doing
    Quote Originally Posted by susejunky View Post
    Code:
    # grub2-mkconfig -o /boot/grub2/grub.cfg
    I get the error
    Code:
    Found openSUSE Tumbleweed on /dev/sdb6
    ERROR: failed to lookup root id: Inappropriate ioctl for device
    To fix this it is required to do
    Code:
    # mount /.snapshots/
    (according to https://www.reddit.com/r/openSUSE/comments/7y7l6m/tw_updating_bootloader_failed/)

    Could you please add this to your instructions?

  3. #13
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    277

    Default Re: Repair a broken UEFI/GRUB2/openSUSE boot scenario

    Quote Originally Posted by squan View Post
    ... Although, I found when having a btrfs root filesystem it needs another mount in order to let grub2-mkconfig succeed, see below.
    Thank you very much for reading and testing my post.

    As i mentioned at the start of my post i use "ext4" not "btrfs" and therefor do not know if my instructions will work when "btrfs" is used.

    Quote Originally Posted by squan View Post
    ... After this command the "Boot0004" entry is no longer listed. Is this expected?
    The command
    Code:
    # efibootmgr -b 0004 -B
    delets a boot entry from the UEFIs NVRAM.

    I must admit my description here is misleading. Deleting an entry will indeed change the bootorder however that may not be the real reason to use this command.

    The command
    Code:
    # efibootmgr -o XXXX,YYYY,ZZZZ
    will change the boot order to XXXX first, YYYY second and ZZZZ third.


    Quote Originally Posted by squan View Post
    ... And just for my unterstanding, how do you know that "0004" is the correct entry?
    You can check the contents of the UEFIs NVRAM with
    Code:
    # efibootmgr -v
    BootCurrent: 0003
    Timeout: 2 seconds
    BootOrder: 0003,0005,0001,0000
    Boot0000* Win...
    Boot0003* opensuse    HD(5,GPT,a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6,0xacbe800,0x200000)/File(\EFI\OPENSUSE\GRUBX64.EFI)..BO
    Boot0005* Ubu...
    This tells you the current boot order (0003,0005,0001,0000) and what each boot entry points to (e.g. 0003 will start openSUSE). So you can delete a specific entry or just rearrange the boot order using the command above.

    Quote Originally Posted by squan View Post
    ...Could you please add this to your instructions?
    Sorry! I definitely would like to do so. But in this forum there is now way to change an existing post that is more than few minutes old. One must read a thread to the very end to gather all its information.

    Regards

    susejunky

Page 2 of 2 FirstFirst 12

Posting Permissions

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