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

ant*_*ex3 4 upgrade grub2 grub-efi 18.04

我有多个运行 Ubuntu 18.04.5 LTS 的服务器。运行apt-get update后后,我在每台服务器上都收到此错误。

\n
Setting up grub-efi-amd64 (2.04-1ubuntu44) ...\n\nCreating config file /etc/default/grub with new version\nInstalling for x86_64-efi platform.\ngrub-install: error: cannot find EFI directory.\nFailed: grub-install --target=x86_64-efi  \nWARNING: Bootloader is not properly installed, system may not be bootable\nSetting up grub-efi-amd64-signed (1.167~18.04.1+2.04-1ubuntu44) ...\nInstalling for x86_64-efi platform.\ngrub-install: error: cannot find EFI directory.\ndpkg: error processing package grub-efi-amd64-signed (--configure):\n installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1\nSetting up grub-efi (2.02-2ubuntu8.23) ...\nProcessing triggers for install-info (6.5.0.dfsg.1-2) ...\nProcessing triggers for systemd (237-3ubuntu10.47) ...\nProcessing triggers for man-db (2.8.3-2ubuntu0.1) ...\nProcessing triggers for ureadahead (0.100.0-21) ...\nErrors were encountered while processing:\n grub-efi-amd64-signed\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n
Run Code Online (Sandbox Code Playgroud)\n

我试过

\n
apt-get remove --purge grub*\napt-get install grub-efi\n
Run Code Online (Sandbox Code Playgroud)\n

我收到了同样的错误。

\n

分开-l

\n
Model: ATA INTEL SSDSC2BB48 (scsi)\nDisk /dev/sda: 480GB\nSector size (logical/physical): 512B/4096B\nPartition Table: msdos\nDisk Flags: \n\nNumber  Start   End    Size   Type     File system     Flags\n 1      2097kB  538MB  536MB  primary  ext4            boot, raid\n 2      538MB   480GB  479GB  primary  ext4            raid\n 3      480GB   480GB  536MB  primary  linux-swap(v1)\n\n\nModel: ATA INTEL SSDSC2BB48 (scsi)\nDisk /dev/sdb: 480GB\nSector size (logical/physical): 512B/4096B\nPartition Table: msdos\nDisk Flags: \n\nNumber  Start   End    Size   Type     File system     Flags\n 1      2097kB  538MB  536MB  primary  ext4            boot, raid\n 2      538MB   480GB  479GB  primary  ext4            raid\n 3      480GB   480GB  536MB  primary  linux-swap(v1)\n\n\nModel: Linux Software RAID Array (md)\nDisk /dev/md2: 479GB\nSector size (logical/physical): 512B/4096B\nPartition Table: loop\nDisk Flags: \n\nNumber  Start  End    Size   File system  Flags\n 1      0.00B  479GB  479GB  ext4\n\n\nModel: Linux Software RAID Array (md)\nDisk /dev/md1: 536MB\nSector size (logical/physical): 512B/4096B\nPartition Table: loop\nDisk Flags: \n\nNumber  Start  End    Size   File system  Flags\n 1      0.00B  536MB  536MB  ext4\n
Run Code Online (Sandbox Code Playgroud)\n

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

\n
NAME    MOUNTPOINT LABEL       SIZE FSTYPE            UUID                                 PARTUUID\nsda                          447.1G                                                        \n\xe2\x94\x9c\xe2\x94\x80sda1                         511M linux_raid_member c364765a-3520-35be-a4d2-adc226fd5302 b6b3ff9d-01\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80md1 /boot      /boot       511M ext4              97d71870-bf9f-417c-b574-a2029e1d3957 \n\xe2\x94\x9c\xe2\x94\x80sda2                       446.1G linux_raid_member 7dd31816-8619-f750-a4d2-adc226fd5302 b6b3ff9d-02\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80md2 /          /         446.1G ext4              ff05852d-7f0f-4f80-ab89-cfe3397b6411 \n\xe2\x94\x94\xe2\x94\x80sda3  [SWAP]     swap-sda3   511M swap              86e64442-6f61-4606-9e87-18af89b5feab b6b3ff9d-03\nsdb                          447.1G                                                        \n\xe2\x94\x9c\xe2\x94\x80sdb1                         511M linux_raid_member c364765a-3520-35be-a4d2-adc226fd5302 5c50a432-01\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80md1 /boot      /boot       511M ext4              97d71870-bf9f-417c-b574-a2029e1d3957 \n\xe2\x94\x9c\xe2\x94\x80sdb2                       446.1G linux_raid_member 7dd31816-8619-f750-a4d2-adc226fd5302 5c50a432-02\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80md2 /          /         446.1G ext4              ff05852d-7f0f-4f80-ab89-cfe3397b6411 \n\xe2\x94\x94\xe2\x94\x80sdb3  [SWAP]     swap-sdb3   511M swap              9f3d62fc-3c8c-474c-b844-fe7e325d19a2 5c50a432-03\n
Run Code Online (Sandbox Code Playgroud)\n

猫 /etc/fstab

\n
# <file system> <mount point>   <type>  <options>   <dump>  <pass>\n/dev/md2    /   ext4    errors=remount-ro,discard   0   1\n/dev/md1    /boot   ext4    errors=remount-ro,discard   0   1\n/dev/sda3   swap    swap    defaults    0   0\n/dev/sdb3   swap    swap    defaults    0   0\nproc        /proc   proc    defaults        0   0\nsysfs       /sys    sysfs   defaults        0   0\n
Run Code Online (Sandbox Code Playgroud)\n

小智 8

我的解决方案是:

sudo apt remove grub-efi-amd64-signed
sudo apt install grub-pc
Run Code Online (Sandbox Code Playgroud)

在 OVH 服务器上 (kimsufi)