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

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]

    .:https://github.com/Jetchisel:.

  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
    283

    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

  4. #14
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    960

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

    Hello.
    Very useful for me.
    I just use it.
    Concerning the use which I have just had, I have to make some remarks on the points which required a reflection from my part.
    POST #1 - N°9 : better to use insensitive pattern. In my case label was in small characters.
    Code:
    blkid | grep -i EFI
    POST #1 - N°10 : For people who runs into problem with a dual boot opensuse - windows ( like me ) after mounting the efi partition :
    Code:
    mount  /dev/sdxy  /tmp
    ls /tmp
    '$RECYCLE.BIN'  EFI  'System Volume Information'
    This is surely a window efi partition.
    but
    Code:
    ls /tmp
    EFI
    This is probably a linux efi partition.

    POST #1 - N°11
    Make sure that "a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6" fits the UUID of the partition which hosts the root file system of the system you want to boot. Use "blkid" to get the UUID of your openSUSE root file system partition.
    do that and If partition still exists you get :
    Code:
    blkid | grep "a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6" 
    /dev/sdvw: LABEL="SOME_LABEL" UUID="a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6" TYPE="ext4" PARTLABEL="primary" PARTUUID="bc325cec-438b-4e15-bd27-a6d8807de242"
    else
    Code:
    blkid | grep "a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6"
    POST #1 - N°13 -a
    Code:
    # mount /dev/sdxy /mnt
    Mounts your openSUSE root file system partition. Use "blkid" to get the UUID.......
    More simpler : Mounts your openSUSE root file system partition using the proper value for "sdxy" found at step 11

    POST #1 - N°13 -b
    Code:
    # mount /dev/sdxz /mnt/boot/efi
    Mounts your EFI system partition. Use "blkid" to get the proper value for "sdxz".
    [/QUOTE]
    More simpler : Mounts your openSUSE efi partition using the proper value for "sdxz" found and/or choosen at step 10

    POST #1 - N°13 -c
    The command cannot work because there is no "boot/efi" folder in /tmp.
    Just mount in /tmp.
    Code:
    # mount /dev/sdxz /mnt
    This point is more sophisticated and should be infirm or confirm by opensuse guru :
    The current system have a physical /boot partition which is different of the root file system partition.
    or
    The current system do not have a physical /boot partition. Then the /boot folder is inside the root file system partition and the installer mount the efi partition in "/boot/efi".
    This does not make difference because after mounting the 2 partitions ( /dev/sdxy and /dev/sdxz ) every folders are in the right place.

    POST #1 - N°14 -15
    Of course you need a working internet conection.

    POST #1 - N°18

    This will check the UEFIs NVRAM. If there is no entry (Bootnnnn) for opensuse you need to create one (replace "sdx" with the device that carries the EFI system partition you want to use; ..........)
    replace "sdx" .... : More simpler : use the proper value for "sdxz" found and/or choosen at step 10

    in "--part n" replace "n" with the number of this EFI system partition
    For me the numbers use by efibootmgr was 0001 and 0002.
    I choose 0003.
    'efibootmgr -v' show then 0000 0001 0002 ? ? ?

    Code:
    blkid
    will help you to find the correct value for "/dev/sdx"
    More simpler : use the proper value for "sdx" found and/or choosen at step 10 for efi partition "sdxz"

    And thanks again for your great job.
    Thanks for helping. JCD
    __________

    server leap 15-- ASUS g75vw KDE leap 42.3 -- ASUS g750JZ KDE leap 42.3 -- acer aspire s13 win 10 home -- asus R900V win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

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
  •