grub2-install 失败,错误为“efibootmgr:选项需要参数 --‘d’”

grub2-install 失败,错误为“efibootmgr:选项需要参数 --‘d’”

我尝试在磁盘上安装 grub2,但总是失败并显示以下错误消息。但是它确认安装已完成,但没有更新 efi 启动项。我必须手动加载内核和 initrd 才能在重启时从 grub shell 启动。

[root@server home]# grub2-install --target=x86_64-efi --efi-directory=/boot/efi /dev/sda
Installing for x86_64-efi platform.
efibootmgr: option requires an argument -- 'd'
efibootmgr version 17
usage: efibootmgr [options]
    -a | --active         sets bootnum active
    -A | --inactive       sets bootnum inactive
    -b | --bootnum XXXX   modify BootXXXX (hex)
    -B | --delete-bootnum delete bootnum
    -c | --create         create new variable bootnum and add to bootorder
    -C | --create-only  create new variable bootnum and do not add to bootorder
    -D | --remove-dups  remove duplicate values from BootOrder
    -d | --disk disk       (defaults to /dev/sda) containing loader
    -r | --driver         Operate on Driver variables, not Boot Variables.
    -e | --edd [1|3|-1]   force EDD 1.0 or 3.0 creation variables, or guess
    -E | --device num      EDD 1.0 device number (defaults to 0x80)
    -g | --gpt            force disk with invalid PMBR to be treated as GPT
    -i | --iface name     create a netboot entry for the named interface
    -l | --loader name     (defaults to "\EFI\centos\grub.efi")
    -L | --label label     Boot manager display label (defaults to "Linux")
    -m | --mirror-below-4G t|f mirror memory below 4GB
    -M | --mirror-above-4G X percentage memory to mirror above 4GB
    -n | --bootnext XXXX   set BootNext to XXXX (hex)
    -N | --delete-bootnext delete BootNext
    -o | --bootorder XXXX,YYYY,ZZZZ,...     explicitly set BootOrder (hex)
    -O | --delete-bootorder delete BootOrder
    -p | --part part        partition containing loader (defaults to 1 on partitioned devices)
    -q | --quiet            be quiet
    -t | --timeout seconds  set boot manager timeout waiting for user input.
    -T | --delete-timeout   delete Timeout.
    -u | --unicode | --UCS-2  handle extra args as UCS-2 (default is ASCII)
    -v | --verbose          print additional information
    -V | --version          return version and exit
    -w | --write-signature  write unique sig to MBR if needed
    -y | --sysprep          Operate on SysPrep variables, not Boot Variables.
    -@ | --append-binary-args file  append extra args from file (use "-" for stdin)
    -h | --help             show help/usage
Installation finished. No error reported.

我尝试手动添加 efi 启动项,但仍然进入 grub shell。此处报告了相同的问题:https://bugzilla.redhat.com/show_bug.cgi?id=1758621但似乎没有办法解决这个问题。有人能帮我解决这个问题吗?我使用的是 CentOS Linux 版本 7.9.2009(核心版)。

相关内容