Grub 在 Apt 升级时崩溃(grub-install:错误:找不到 EFI 目录)

Grub 在 Apt 升级时崩溃(grub-install:错误:找不到 EFI 目录)

我有多台服务器安装了 Ubuntu 18.04.5 LTS。运行apt-get 升级我的每台服务器都收到了此错误。

Setting up grub-efi-amd64 (2.04-1ubuntu44) ...

Creating config file /etc/default/grub with new version
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
Failed: grub-install --target=x86_64-efi  
WARNING: Bootloader is not properly installed, system may not be bootable
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
Setting up grub-efi (2.02-2ubuntu8.23) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for systemd (237-3ubuntu10.47) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Errors were encountered while processing:
 grub-efi-amd64-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)

我试过

apt-get remove --purge grub*
apt-get install grub-efi

我收到了同样的错误。

分开

Model: ATA INTEL SSDSC2BB48 (scsi)
Disk /dev/sda: 480GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system     Flags
 1      2097kB  538MB  536MB  primary  ext4            boot, raid
 2      538MB   480GB  479GB  primary  ext4            raid
 3      480GB   480GB  536MB  primary  linux-swap(v1)


Model: ATA INTEL SSDSC2BB48 (scsi)
Disk /dev/sdb: 480GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system     Flags
 1      2097kB  538MB  536MB  primary  ext4            boot, raid
 2      538MB   480GB  479GB  primary  ext4            raid
 3      480GB   480GB  536MB  primary  linux-swap(v1)


Model: Linux Software RAID Array (md)
Disk /dev/md2: 479GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system  Flags
 1      0.00B  479GB  479GB  ext4


Model: Linux Software RAID Array (md)
Disk /dev/md1: 536MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system  Flags
 1      0.00B  536MB  536MB  ext4

lsblk -o 名称,挂载点,标签,大小,fstype,uuid,partuuid | egrep -v "^loop"

NAME    MOUNTPOINT LABEL       SIZE FSTYPE            UUID                                 PARTUUID
sda                          447.1G                                                        
├─sda1                         511M linux_raid_member c364765a-3520-35be-a4d2-adc226fd5302 b6b3ff9d-01
│ └─md1 /boot      /boot       511M ext4              97d71870-bf9f-417c-b574-a2029e1d3957 
├─sda2                       446.1G linux_raid_member 7dd31816-8619-f750-a4d2-adc226fd5302 b6b3ff9d-02
│ └─md2 /          /         446.1G ext4              ff05852d-7f0f-4f80-ab89-cfe3397b6411 
└─sda3  [SWAP]     swap-sda3   511M swap              86e64442-6f61-4606-9e87-18af89b5feab b6b3ff9d-03
sdb                          447.1G                                                        
├─sdb1                         511M linux_raid_member c364765a-3520-35be-a4d2-adc226fd5302 5c50a432-01
│ └─md1 /boot      /boot       511M ext4              97d71870-bf9f-417c-b574-a2029e1d3957 
├─sdb2                       446.1G linux_raid_member 7dd31816-8619-f750-a4d2-adc226fd5302 5c50a432-02
│ └─md2 /          /         446.1G ext4              ff05852d-7f0f-4f80-ab89-cfe3397b6411 
└─sdb3  [SWAP]     swap-sdb3   511M swap              9f3d62fc-3c8c-474c-b844-fe7e325d19a2 5c50a432-03

猫/etc/fstab

# <file system> <mount point>   <type>  <options>   <dump>  <pass>
/dev/md2    /   ext4    errors=remount-ro,discard   0   1
/dev/md1    /boot   ext4    errors=remount-ro,discard   0   1
/dev/sda3   swap    swap    defaults    0   0
/dev/sdb3   swap    swap    defaults    0   0
proc        /proc   proc    defaults        0   0
sysfs       /sys    sysfs   defaults        0   0

答案1

对我来说,解决方案是:

sudo apt remove grub-efi-amd64-signed
sudo apt install grub-pc

在 OVH 服务器 (kimsufi) 上

相关内容