web-dev-qa-db-ja.com

GRUB2 EFIは、電源投入直後にF12を打っていない限り、GRUBシェルに落ちます

私は私のASUS ROGラップトップでWindows 10と一緒にopenSUSE TOMBLEWEDを持っています。
[。]問題はかなり変わっています。
[。]が電源投入直後または再起動中にF12を押すと、通常のGRUB2メニューが表示され、問題なくopenSUSEまたはWINDOWSに起動できます。それはとても厄介です。誰もがこの問題を助けることができますか?
[。] Windowsパーティションをマウントするには、/etc/fstabでエントリを追加する以外は、設定ファイルを変更しませんでしたが、関連があるとは思わない。

/boot/efi/EFI/opensuse/grub.cfg:

search --fs-uuid --set=root 884f4184-2900-4123-a4be-60df5a0f0ad0
set prefix=(${root})/grub2
configfile $prefix/grub.cfg

/boot/grub2/grub.cfg:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -f ${config_directory}/grubenv ]; then
  load_env -f ${config_directory}/grubenv
Elif [ -s $prefix/grubenv ]; then
  load_env
fi

if [ "${env_block}" ] ; then
  load_env -f "${env_block}"
fi

if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   if [ "${env_block}" ] ; then
     save_env -f "${env_block}" next_entry
   fi
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt 
insmod btrfs
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  6159e15d-f224-499d-88e0-437b5538f0f1
else
  search --no-floppy --fs-uuid --set=root 6159e15d-f224-499d-88e0-437b5538f0f1
fi
    font="/.snapshots/1/snapshot/usr/share/grub2/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=POSIX
  insmod gettext
fi
terminal_output gfxterm
insmod part_gpt 
insmod ext2
set root='hd1,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt4 --hint-efi=hd1,gpt4 --hint-baremetal=ahci1,gpt4  884f4184-2900-4123-a4be-60df5a0f0ad0
else
  search --no-floppy --fs-uuid --set=root 884f4184-2900-4123-a4be-60df5a0f0ad0
fi
insmod gfxmenu
loadfont ($root)/grub2/themes/openSUSE/DejaVuSans-Bold14.pf2
loadfont ($root)/grub2/themes/openSUSE/DejaVuSans10.pf2
loadfont ($root)/grub2/themes/openSUSE/DejaVuSans12.pf2
loadfont ($root)/grub2/themes/openSUSE/ascii.pf2
insmod png
set theme=($root)/grub2/themes/openSUSE/theme.txt
export theme
if [ x${boot_once} = xtrue ]; then
  set timeout=0
Elif [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/00_tuned ###
set tuned_params=""
### END /etc/grub.d/00_tuned ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'openSUSE Tumbleweed'  --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-6159e15d-f224-499d-88e0-437b5538f0f1' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt 
    insmod ext2
    set root='hd1,gpt4'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt4 --hint-efi=hd1,gpt4 --hint-baremetal=ahci1,gpt4  884f4184-2900-4123-a4be-60df5a0f0ad0
    else
      search --no-floppy --fs-uuid --set=root 884f4184-2900-4123-a4be-60df5a0f0ad0
    fi
    echo    'Loading Linux 4.4.0-1-default ...'
    linux   /vmlinuz-4.4.0-1-default root=UUID=6159e15d-f224-499d-88e0-437b5538f0f1 rootflags=subvol=.snapshots/1/snapshot  quiet splash=silent
    echo    'Loading initial ramdisk ...'
    initrd  /initrd-4.4.0-1-default
}
submenu 'Advanced options for openSUSE Tumbleweed' --hotkey=1 $menuentry_id_option 'gnulinux-advanced-6159e15d-f224-499d-88e0-437b5538f0f1' {
    menuentry 'openSUSE Tumbleweed, with Linux 4.4.0-1-default' --hotkey=2 --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-1-default-advanced-6159e15d-f224-499d-88e0-437b5538f0f1' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt 
        insmod ext2
        set root='hd1,gpt4'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt4 --hint-efi=hd1,gpt4 --hint-baremetal=ahci1,gpt4  884f4184-2900-4123-a4be-60df5a0f0ad0
        else
          search --no-floppy --fs-uuid --set=root 884f4184-2900-4123-a4be-60df5a0f0ad0
        fi
        echo    'Loading Linux 4.4.0-1-default ...'
        linux   /vmlinuz-4.4.0-1-default root=UUID=6159e15d-f224-499d-88e0-437b5538f0f1 rootflags=subvol=.snapshots/1/snapshot  quiet splash=silent
        echo    'Loading initial ramdisk ...'
        initrd  /initrd-4.4.0-1-default
    }
    menuentry 'openSUSE Tumbleweed, with Linux 4.4.0-1-default (recovery mode)' --hotkey=3 --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-1-default-recovery-6159e15d-f224-499d-88e0-437b5538f0f1' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt 
        insmod ext2
        set root='hd1,gpt4'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt4 --hint-efi=hd1,gpt4 --hint-baremetal=ahci1,gpt4  884f4184-2900-4123-a4be-60df5a0f0ad0
        else
          search --no-floppy --fs-uuid --set=root 884f4184-2900-4123-a4be-60df5a0f0ad0
        fi
        echo    'Loading Linux 4.4.0-1-default ...'
        linux   /vmlinuz-4.4.0-1-default root=UUID=6159e15d-f224-499d-88e0-437b5538f0f1 rootflags=subvol=.snapshots/1/snapshot  
        echo    'Loading initial ramdisk ...'
        initrd  /initrd-4.4.0-1-default
    }
    menuentry 'openSUSE Tumbleweed, with Linux 4.3.3-5-default'  --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.3.3-5-default-advanced-6159e15d-f224-499d-88e0-437b5538f0f1' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt 
        insmod ext2
        set root='hd1,gpt4'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt4 --hint-efi=hd1,gpt4 --hint-baremetal=ahci1,gpt4  884f4184-2900-4123-a4be-60df5a0f0ad0
        else
          search --no-floppy --fs-uuid --set=root 884f4184-2900-4123-a4be-60df5a0f0ad0
        fi
        echo    'Loading Linux 4.3.3-5-default ...'
        linux   /vmlinuz-4.3.3-5-default root=UUID=6159e15d-f224-499d-88e0-437b5538f0f1 rootflags=subvol=.snapshots/1/snapshot  quiet splash=silent
        echo    'Loading initial ramdisk ...'
        initrd  /initrd-4.3.3-5-default
    }
    menuentry 'openSUSE Tumbleweed, with Linux 4.3.3-5-default (recovery mode)' --hotkey=1 --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.3.3-5-default-recovery-6159e15d-f224-499d-88e0-437b5538f0f1' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt 
        insmod ext2
        set root='hd1,gpt4'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt4 --hint-efi=hd1,gpt4 --hint-baremetal=ahci1,gpt4  884f4184-2900-4123-a4be-60df5a0f0ad0
        else
          search --no-floppy --fs-uuid --set=root 884f4184-2900-4123-a4be-60df5a0f0ad0
        fi
        echo    'Loading Linux 4.3.3-5-default ...'
        linux   /vmlinuz-4.3.3-5-default root=UUID=6159e15d-f224-499d-88e0-437b5538f0f1 rootflags=subvol=.snapshots/1/snapshot  
        echo    'Loading initial ramdisk ...'
        initrd  /initrd-4.3.3-5-default
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-AE4A-03B2' {
    insmod part_gpt 
    insmod fat
    set root='hd0,gpt1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  AE4A-03B2
    else
      search --no-floppy --fs-uuid --set=root AE4A-03B2
    fi
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
Elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/80_suse_btrfs_snapshot ###
### END /etc/grub.d/80_suse_btrfs_snapshot ###

### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###

/etc/fstab:

UUID=2743aca8-ab1f-44d8-813d-bbb615ba4188 swap swap defaults 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 / btrfs defaults 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /home btrfs subvol=home 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /opt btrfs subvol=opt 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /srv btrfs subvol=srv 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /tmp btrfs subvol=tmp 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /usr/local btrfs subvol=usr/local 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/crash btrfs subvol=var/crash 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/lib/libvirt/images btrfs subvol=var/lib/libvirt/images 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/lib/mailman btrfs subvol=var/lib/mailman 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/lib/mariadb btrfs subvol=var/lib/mariadb 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/lib/mysql btrfs subvol=var/lib/mysql 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/lib/named btrfs subvol=var/lib/named 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/lib/pgsql btrfs subvol=var/lib/pgsql 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/log btrfs subvol=var/log 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/opt btrfs subvol=var/opt 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/spool btrfs subvol=var/spool 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /var/tmp btrfs subvol=var/tmp 0 0
UUID=6159e15d-f224-499d-88e0-437b5538f0f1 /.snapshots btrfs subvol=.snapshots 0 0
UUID=AE4A-03B2       /boot/efi            vfat       umask=0002,utf8=true  0 0
UUID=884f4184-2900-4123-a4be-60df5a0f0ad0    /boot/    ext2    rw,relatime,stripe=4    0 0
UUID=5644A7CA44A7AAE7 /windows             ntfs-3g    ro,users,gid=users,fmask=133,dmask=022,locale=pl_PL.UTF-8 0 0
UUID=EAAE2A7FAE2A4503 /windows/data-and-programs ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=pl_PL.UTF-8 0 0

編集:
[。] efibootmgr -vの出力:

BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0000,0001,0002,0004
Boot0000* opensuse-secureboot   HD(1,GPT,5a12695d-97ad-485a-b393-c00a89d1b0d8,0x800,0x32000)/File(\EFI\opensuse\shim.efi)
Boot0001* opensuse  HD(1,GPT,5a12695d-97ad-485a-b393-c00a89d1b0d8,0x800,0x32000)/File(\EFI\opensuse\grubx64.efi)
Boot0002* Windows Boot Manager  HD(1,GPT,5a12695d-97ad-485a-b393-c00a89d1b0d8,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...d................
Boot0004* UEFI OS   HD(1,GPT,5a12695d-97ad-485a-b393-c00a89d1b0d8,0x800,0x32000)/File(\EFI\BOOT\BOOTX64.EFI)
1
ElmoVanKielmo

GRUBシェルによって、私は通常のシェルの代わりにGRUB Rescueシェルを意味すると思います。

その理由はおそらく、ESP(「最初のドライブ」にある)のGRUB EFIバイナリがUEFIによって実行されたときに「2番目のドライブ」が準備ができていないため、バイナリgrub modulesとgrub.cfg(/ bootのパーティションがない場合は、sdb3の/ bootディレクトリにあります)を見つけませんでした。

これを解決するには、UEFI設定(Windowsではなく)の「高速起動」オプションを無効にすることを試みることができます。 それでもうまくいかない場合は、モジュールとgrub.cfgがESPに置かれているようにGRUBを再インストールする必要があります(--boot-directory/boot/efi、想定 - -efi-directoryは/ boot/efiです)。 または実際には、/起動にESPを使用してみて、カーネルがルートファイルシステム(SDB3)をマウントしようとすると、2番目のドライブがUEFIによって準備されていることを願っています。

1
Tom Yan