picodotdev / alis

Arch Linux Install Script (or alis, also known as the Arch Linux executable installation guide and wiki) installs an unattended, automated and customized Arch Linux system.
https://picodotdev.github.io/alis/
GNU General Public License v3.0
823 stars 319 forks source link

Root device set improperly with LUKS and systemd #125

Closed ottoborden closed 3 years ago

ottoborden commented 3 years ago

Hey,

I'm still learning Linux and Arch so please bare with me, I'll try to give as much useful information as I can.

So I'm working on setting up a VM (KVM) using this script. I'm mostly using the defaults. First time I ran through it with BIOS set and grub boot loader was used with no issues. However I'm fumbling my way through getting early user space to make HTTP calls and decided to try UEFI with systemd to leverage some tools I found for assisting with initramfs.

So when the VM is set to use OVMF BIOS (UEFI), LVM="false" and LUKS is enabled (a LUKS password is set) the script completes and the VM reboots. After reboot it begins the boot process and gets stuck right after Starting Cryptography Setup for cryptroot: Failed to mount /sysroot.

After some digging I found that the loader/entries/arch.conf file on /dev/sda1 was configured as root=PARTUUID=$PARTUUID_ROOT. This comes from line 1158 of alis.sh. I changed that line to be root=/dev/mapper/$LUKS_DEVICE_NAME, reinstalled, and it booted as expected.

I hope this is understandable and can be of some use.

picodotdev commented 3 years ago

Thanks for the report.

I have tested in VirtualBox with the same result. I tried to search some reports, I found these:

https://www.reddit.com/r/archlinux/comments/n5kgmr/unable_to_boot_encrypted_system/ https://bbs.archlinux.org/viewtopic.php?id=251762 https://gist.github.com/bjcubsfan/bc54704006789949ab6d54d71cb32336 https://bbs.archlinux.org/viewtopic.php?pid=1977204#p1977204 https://forum.garudalinux.org/t/trying-to-boot-with-intel-vmd-enabled/4774/2 https://bugs.archlinux.org/task/68704 https://bbs.archlinux.org/viewtopic.php?id=267043

I tried the solution commented in those articles (set KERNELS_PARAMETERS="nvme_load=YES" and MODULES="vmd"), with these options not fails with a message cryptroot: Failed to mount /sysroot but the boot hangs after entering the root encryption password for uncloking it.

Not sure if is something specific to luks/systemd-boot/root=PARTUUID? This needs more testing before use the solution root=/dev/mapper/$LUKS_DEVICE_NAME that worked for you. For example, the same works for GRUB instead for systemd-boot?

picodotdev commented 3 years ago

Not sure, may is related to this open bug. There are some screenshots attached with the same issue.

https://bugs.archlinux.org/task/70272?project=1&string=systemd

Maybe this upstream issue fixed a few days ago fixes the problem.

https://github.com/systemd/systemd/pull/19878

So maybe is a matter to wait for working packages arrive to arch repositories.

picodotdev commented 3 years ago

Finally I hope that is fixed applying your suggestion of using root=/dev/mapper/cryptroot.

Thanks again for your report and suggestion @ottoborden.