I am using grub2 on an mbr disk (not EFI) to boot Xubuntu 16.04.
I have sort of a specialized setup, as follows:
/dev/sda - MBR - Grub2 installed
/dev/sda1 - ext2 - /mnt/boot
/dev/sda2 - extended
/dev/sda5 - crypt-luks container with LVM setup inside
I have moved the files:
initrd.img-4.4.0-22-generic
vmlinuz-4.4.0-22-generic
System.map-4.4.0-22-generic
config-4.4.0-22-generic
abi-4.4.0-22-generic
to the /boot
directory on my root filesystem.
I left the grub directory on /dev/sda1
and mounted /dev/sda1
at /mnt/boot
. I then created a symlink on /boot/grub
to /mnt/boot/grub
. I am using grub2's builtin crypto modules to unlock my crypt-luks
container with:
GRUB_ENABLE_CRYPTODISK=y
I am also using two scripts and an extra keyfile on my luks container to bypass a second password prompt. The first being created by grub to boot the disk and the second created by luks to unlock the disk. I used this tutorial here.
The issue I am having is: when I boot the machine I am presented with a password prompt from grub, but this prompt is broken. If I enter the passphrase correctly it will not boot. I have to use the escape key to view the grub menu and select the correct entry which will then give me the same prompt, but this time it will accept the key.
How can I make the correct entry boot automatically instead of the broken prompt?
The chances of anyone else ever having this problem are slim (maybe if someone followed the same guide), but here is how I solved it.
Using grub-customizer, I reverted the grub menu to default. Make sure that the menu entry you wish to use is
script: linux
notscript: custom
. Then I removed the "Advanced options for Ubuntu" and deleted my old entry. Save and reload the configuration, and bravo! The first prompt now works for decryption.