theplusone n00b
Joined: 22 Jul 2021 Posts: 1
|
Posted: Thu Jul 22, 2021 12:50 am Post subject: [Solved] Can't boot into luks+lvm system after kernel update |
|
|
Hi all,
I recently emerged sys-kernel/gentoo-sources 5.10.52 and genkernel'd as I would on my other Gentoo machines, but I (presumably) made a mistake by forgetting the --luks and --lvm flags on genkernel (first time trying luks+lvm). So, when I rebooted, I was met with this:
Code: | >> Determining root device (trying /dev/mapper/vg0-root) ........
!! Block device /dev/mapper/vg0-root is not a valid root device ...
!! Could not find the root block device in /dev/mapper/vg0-root.
!! Please specify another value or:
!! - press Enter for the same
!! - type "shell" for a shell
!! - type "q" to skip ...
root block device(/dev/mapper/vg0-root) :: |
After some discussion in the #gentoo irc channel, I booted from a livecd, managed to mount my root volume, mounted /boot, chrooted in, and compiled the kernel with "genkernel --lvm --luks --install all". This placed the necessary files in /boot, and I assumed that my issue was fixed from there. Upon reboot, the issue unfortunately persisted. Strangely enough (and this might be a key detail?), the old kernel -- the one that /used to/ not have any issues booting correctly -- didn't work either, giving me the same error.
Since I am able to decrypt and mount fine from a Gentoo livecd, and I can use cryptsetup and lvm vgscan/vgchange/lvs/etc to poke the volume from the rescue shell, my (probably naive) guess is that I messed something up with GRUB. This line is at the bottom of my /etc/default/grub:
Code: | GRUB_CMDLINE_LINUX=dolvm crypt_root=UUID=784ba7d1-a3eb-4162-afa8-d1799f70f7cc |
Here's the relevant blkid (excluding a Windows partition I never touch):
Code: | /dev/loop0: TYPE="squashfs"
/dev/nvme0n1p1: UUID="2A4D-38FB" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="grub" PARTUUID="88211f02-5c86-48cd-81bd-9e3b41b5ae9f"
/dev/nvme0n1p2: UUID="9549-58D8" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="boot" PARTUUID="b3be2f8e-d3e5-452c-b811-14321313ad3d"
/dev/nvme0n1p3: UUID="784ba7d1-a3eb-4162-afa8-d1799f70f7cc" TYPE="crypto_LUKS" PARTLABEL="lvm" PARTUUID="43bc0b86-6d44-4baf-a815-b32b246dd4de"
/dev/mapper/myvolume: UUID="XMG3I4-po5H-vgNn-hzJn-fQFG-9cqg-Qz8IC0" TYPE="LVM2_member"
/dev/mapper/vg0-root: UUID="da8fc77b-da47-4926-836a-3667081612e1" BLOCK_SIZE="4096" TYPE="ext4"
(myvolume is the temporary name I'm using for cryptsetup from the livecd) |
Here's /boot/grub/grub.cfg, as generated by grub-mkconfig: https://gist.githubusercontent.com/theplusone/695abb29085d2e00546dec62950cf518/raw/25a73bfdd8a00e67f2fdb2379d13f191dd28cff9/grub.cfg
Finally, here's /etc/fstab, though I'm not even sure if this matters since it's not even mounting / anyways:
Code: | UUID=9549-58D8 /boot vfat noauto,noatime 1 2
UUID=da8fc77b-da47-4926-836a-3667081612e1 / ext4 defaults 0 1 |
Any help is greatly appreciated, and thank you in advance!
---
Hi again,
I suppose it'd be best to leave this up in case anyone else runs into the same issue. Long story short, crypt_root was not making its way into /boot/grub/grub.cfg. Putting the GRUB_CMDLINE_LINUX value in quotes and rerunning grub-mkconfig fixed things. |
|