I have just installed Ubuntu on an old (3-4 years old) HP laptop.
At the time of the installation the BIOS was setup for "Legacy Boot Mode" and the "Secure Boot" option was disabled. (Understandably so, since all BIOSes deactivate secure boot when supporting legacy mode i.e. dos AFAIK). Unfortunately though, I never realized this at the time of installation.
I followed this great community guide for manual full system encryption which even ensures that the boot partition is encrypted. As part of the scripts made by the author of that guide, grub is installed with the following command:
grub-install --target=x86_64-efi --uefi-secure-boot --efi-directory=/boot/efi --bootloader=ubuntu --boot-directory=/boot/efi/EFI/ubuntu --recheck /dev/[DRIVE]
I'm not sure what the --uefi-secure-boot
flag does but the installation worked perfectly and my system was running.
I then realised that the secure boot was disabled in the BIOS, wanted to change this, and disabled legacy mode support and enabled secure boot. For some reason my machine doesn't boot now. It shows the error as displayed as in the screenshot below:
If I disable secure boot (Note: only secure boot, but still leave legacy mode support disabled as well), then the boot works perfectly again.
Note: In the image the device with UUID beginning with "29bb6762" is my boot partition.
Note2: Following is the how my HDD is partitioned. (exactly the same as in the linked Manual Full System Encryption wiki
/dev/sda1 - UEFI partition. FAT 32
/dev/sda2 - LUKS
/dev/mapper/system-root
/dev/mapper/system-boot
/dev/mapper/system-swap
- The root, boot, and swap are sitting on a volume group. (The LUKS partition is formatted as LVM)
- and /dev/mapper/system-boot has the same device id as the grub error in the screenshot.