I have this issue on multiple Ubuntu 18.04 (Bionic Beaver) servers.
During a regular apt update && apt upgrade, I get this error:
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 I'm on a server, I don't use GRUB, and I never heard of EFI. I didn't change any of its settings as far as I know.
I have /dev/md1 mounted on /boot, and I see I have a directory /boot/efi, but it's empty.
How can I fix this issue?
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, second server:
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
grub-efi. You also should spend some time trying to find out how this happened, and make sure legacy grub is actually installed.apt upgradeand it shows2020-09-07 15:10:55 upgrade grub-efi-amd64-bin:amd64 2.02-2ubuntu8.17 2.02-2ubuntu8.18...status installed grub-efi-amd64:amd64 2.02-2ubuntu8.18. So it seems it was there from the image of my provider (they are OVH dedicated servers)df -This missing/boot/efi. After mounting it the package installed correctly and issue disappeared.