[SOLVED] Add keyfile to unlock the system
I have artix installed with full disk encryption and the grub-improved-luks2-git bootloader from AUR. I need to add a keyfile so that I only have to enter the password once instead of twice. Here is a list of what I did:
sudo -i
mkdir /root/secrets
dd bs=512 count=4 if=/dev/urandom of=/root/secrets.x230.bin
chmod 000 /root/secrets.x230.bin
# "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" I replaced it with the value for /dev/sda2 from the command "ls -l /dev/disk/by-uuid"
cryptsetup luksAddKey /dev/disk/by-uuid/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /root/secrets.x230.bin
# I tried using this command instead of the one above "cryptsetup luksAddKey /dev/sda2 /root/secrets.x230.bin"
# Edit /etc/mkinitcpio.conf
FILES=(/root/secrets.x230.bin)
HOOKS=(base udev autodetect modconf kms encrypt keyboard keymap consolefont block lvm2 filesystems fsck)
mkinitcpio -P
reboot
After that I expect to enter the password only once, but I am greeted with a second prompt to enter the disk password. I don't know if it makes sense, but I regenerated the grub file and reinstalled the bootloader by doing:
grub-mkconfig -o /boot/grub/grub.cfg
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub /dev/sda --recheck
But the problem remains. I also tried to unlock the disk with the key (/root/secrets.x230.bin) from the LiveCD and it works.
Tell me, what did I miss?