You are not logged in.
Hello!
I'm having some trouble booting into an LVM on LUKS setup. I'm using a Universal Kernel Image to boot, using dracut as my initramfs. When I boot the image, I'm able to get it to decrypt the main block device, but it fails to activate the volume group, and then drops me to an emergency shell. Since I used dracut, I was able to see what went wrong with gpt-auto-root. It tries mounting the decrypted block device directly, /dev/mapper/root, which fails since it's an lvm. If I run lvm_scan in the emergency shell, it notices the new volume group and activates it without issue, which I'm then able to mount. But systemd is broken at this point or something so exiting the shell freezes the whole system.
How can I get dracut to figure out how to mount root so it can boot properly? Thank you.
I'll now post all the information regarding dracut/partition layouts.
# (lsblk, partial output)
nvme0n1 259:0 0 476.9G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
└─nvme0n1p2 259:2 0 476.4G 0 part
└─ssd 252:0 0 476.4G 0 crypt
└─System-root 252:1 0 476.4G 0 lvm /home
/# (blkid, partial output)
/dev/nvme0n1p2: UUID="22334891-e588-49ff-908e-b4bee8fce232" TYPE="crypto_LUKS" PARTUUID="83d8555f-1599-4dbf-aee3-5f066a005605"# (code to build initramfs, using chroot so kernel version is required)
dracut --force --uefi --kver 6.12.4-arch1-1 /boot/efi/EFI/Adastra/adastra.efi --no-hostonly-cmdline -i /etc/crypttab.initramfs /etc/crypttab# /etc/dracut.conf.d/root.conf
kernel_cmdline="fbcon=map:01"# /etc/crypttab.initramfs
# not actually automatically loaded, so manually included. (might be autodetected with regular crypttab from what I've read?)
root UUID=22334891-e588-49ff-908e-b4bee8fce232 noneOne more thing, right now there's no root=... parameter or rd.* since when using them without a crypttab, it didn't even ask for a password. The crypttab was the only way I've gotten a password prompt so far. The fstab is also empty since I'm just trying to get to a working boot process first, but I've tried mounting /dev/System/root before, but it fails since the lv is not activated. I also want to switch back to mkinitcpio again if possible, I'm just using dracut right now since I can actually try diagnosing things with the emergency shell, since root is disabled with mkinitcpio.
Please let me know if you need more information. Thanks again.
Last edited by Develon5543 (2024-12-17 08:44:42)
Offline
Hey again, I managed to write down the boot logs, so maybe they will reveal something new. I typed it out with my phone so it's not formatted perfectly.
(some output is off-screen, no errors though)
Starting Load Kernel Module configfs...
Starting Create System Files and Directories...
[ Ok ] Finished Load Kernel Module configfs.
[ Ok ] Stopped virtual console setup
Stopping virtual console setup...
Starting virtual console setup...
[ Ok ] Finished dracut initqueue hook.
[ Ok ] Reached target preparation for remote file systems.
[ Ok ] Reached target remote encrypted volumes.
[ Ok ] Reached target remote file systems.
[ Ok ] Stopped virtual console setup.
[ Ok ] Finished create system files and directories.
Starting virtual console setup...
[ Ok ] Finished virtual console setup.
[ Ok ] Found device BC711 NVMe SK hynix 512GB 2.
Starting cryptography setup for root...
Please enter passphrase for disk BC711 NVMe SK hynix 512GB (root): (press TAB for no echo) [5.806289] <Several USB errors, non-serious>
[ Ok ] Found device /dev/gpt-auto-root.
[ Ok ] Reached target initrd root device.
[ Ok ] Finished cryptography setup for root.
[ Ok ] Reached target local encrypted volumes.
[ Ok ] Reached target system initialization.
[ Ok ] Reached target basic system.
Starting dracut pre-mount hook...
[ Ok ] Finished dracut pre-mount hook.
Starting file system check on /dev/gpt-auto-root...
[ Ok ] Finished file system check on /dev/gpt-auto-root.
Mounting root partition...
[FAILED] Failed to mount root partition.
See 'systemctl status sysroot.mount' for details.
[DEPEND] Dependency failed for initrd root file system.
[DEPEND] Dependency failed for mountpoints configured in the real root.
<Systemd then stops everything>
[ Ok ] Reached target Emergency Mode.The non-serious USB errors happen on any distro, I don't think they mean anything. When systemd stops everything, it's a bunch of "Stopping x..." messages.
Here is the systemctl status output.
Mounting root partition...
mount: /sysroot: unknown filesystem type 'LVM2_member'.
dmesg(1) may have more information after failed mount system call.
sysroot.mount: Mount process exited, code=exited, status=32/n/a
sysroot.mount: Failed with result 'exit-code'.
Failed to mount root partition.Offline
Hi.
I managed to get it working! It turns out that cmdline stuff is ignored when generating a uki with dracut. You must instead create a new boot entry with efibootmgr and specify the kernel parameters you want with -u. I just needed to set rd.luks.uuid=<uuid> and root=/dev/mapper/<vg>-<lv>. This solution works with both dracut and mkinitcpio so I switched back to mkinitcpio with no issues!
I hope this information helps someone else. Thanks.
Offline