Ubuntu 18.04“grub-install:错误:找不到 EFI 目录”

Ubuntu 18.04“grub-install:错误:找不到 EFI 目录”

我在多个 Ubuntu 18.04(Bionic Beaver)服务器上遇到了这个问题。

在常规过程中apt update && apt upgrade,我收到此错误:

Setting up grub-efi-amd64-signed (1.167~18.04.1+2.04-1ubuntu44) ...
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
dpkg: error processing package grub-efi-amd64-signed (--configure):
installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1

我在服务器上,我不使用GRUB,我从来没有听说过电喷。据我所知,我没有改变它的任何设置。

我有/dev/md1镶嵌在/启动,我看到我有一个目录/启动/efi,但它是空的。

我该如何修复此问题?


fdisk-l:

Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 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: F4BBD515-6E5E-4152-AD41-6D80A4A69583

Device          Start        End    Sectors    Size Type
/dev/sda1          40       2048       2009 1004.5K BIOS boot
/dev/sda2        4096 3905976319 3905972224    1.8T Linux RAID
/dev/sda3  3905976320 3907022847    1046528    511M Linux swap


Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 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: 2C2D425C-9EAF-472D-8820-068D587A47D0

Device          Start        End    Sectors    Size Type
/dev/sdb1          40       2048       2009 1004.5K BIOS boot
/dev/sdb2        4096 3905976319 3905972224    1.8T Linux RAID
/dev/sdb3  3905976320 3907022847    1046528    511M Linux swap


Disk /dev/md2: 1.8 TiB, 1999857713152 bytes, 3905972096 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

fdisk -l,第二台服务器:

Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 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: dos
Disk identifier: 0x762b7381

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         4096   1050623   1046528   511M fd Linux raid autodetect
/dev/sda2         1050624 467808255 466757632 222.6G fd Linux raid autodetect
/dev/sda3       467808256 468854783   1046528   511M 82 Linux swap / Solaris


Disk /dev/md2: 445.1 GiB, 477958766592 bytes, 933513216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes


Disk /dev/md1: 511 MiB, 535756800 bytes, 1046400 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


Disk /dev/sdb: 223.6 GiB, 240057409536 bytes, 468862128 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: dos
Disk identifier: 0x41167758

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1  *         4096   1050623   1046528   511M fd Linux raid autodetect
/dev/sdb2         1050624 467808255 466757632 222.6G fd Linux raid autodetect
/dev/sdb3       467808256 468854783   1046528   511M 82 Linux swap / Solaris

答案1

我在 Legacy BIOS 启动时使用 18.04。我只有这些 grub 包:

  • grub 通用
  • grub-gfxpayload-列表
  • grub-pc
  • grub-pc-bin
  • grub2-通用

可能您必须删除 grub-efi 包:

apt remove grub-efi*

祝你好运!

相关内容