Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LUKS enc. partition - bootloader fails to find the device
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
nomad
n00b
n00b


Joined: 12 Feb 2018
Posts: 8

PostPosted: Sun Jun 16, 2024 4:45 pm    Post subject: LUKS enc. partition - bootloader fails to find the device Reply with quote

Good afternoon, I just ran into a problem installing Gentoo on a Dell Precision 3581 machine. I'm trying to boot the OS from a LUKS-encrypted partition, but the bootloader complains it can't find the device.

My disk layout is as follows (printed from another OS):
Code:

NAME           UUID
(... loops omitted ...)
nvme0n1       
├─nvme0n1p1    382F-EF6F
├─nvme0n1p2   
├─nvme0n1p3    1A5231035230E4E3
├─nvme0n1p4    50AC9F62AC9F4200
├─nvme0n1p5    9cf41608-0fe3-4c02-b121-6e4708806250
└─nvme0n1p6    bf41e4ca-3e6a-47ca-8eb9-e8b8f21ef544
  └─gentoo     4lfDG7-JR4b-8bi6-uXH6-Uoo3-4Oem-jOvXKT
    ├─vg1-root f5e18d0c-c705-4e59-b438-dfd9bf9a3955
    └─vg1-home 87f3482b-2944-4922-ae74-c8c4f0b0dbdb


As I have to keep a Windows partition, due to my employer's policy, I'm using multi-boot scheme. There are:
1,2) Boot, EFI partition;
3) BitLocker-encrypted bootable Windows partition;
4) LUKS-encrypted bootable Ubuntu partition (just for the case that Gentoo needs some recovery, as it does now);
5) BitLocker-encrypted data storage (going to be LUKS-encrypted, hopefully);
6) LUKS-encrypted bootable Gentoo partition (the subject).

On the (6), there is a logical volume with two logical partitions: root and home. I can unlock it and mount it from running Ubuntu without issues. LUKS dump of (6):
https://pastebin.com/NPMw3hmT

Trying to make my life simple, I've chosen to use genkernel with --luks and --lvm switches, at least until the first successful boot. Genkernel output:
https://pastebin.com/E4UYss5i

It seems it creates both the kernel and the initram:
Code:
nomad-Precision-3581 /usr/src/linux # ls /boot -la
total 142020
drwx------  5 root root     4096 led  1  1970  .
drwxr-xr-x 22 root root     4096 úno  8 20:32  ..
-rwx------  1 root root    77312 čen 14 21:17  amd-uc.img
-rwx------  1 root root   251870 čen 15 17:25  config-6.6.30-gentoo-x86_64
drwx------  7 root root     4096 čen 15 18:05  EFI
drwx------  6 root root     4096 čen 16 14:17  grub
-rwx------  1 root root 14264128 čen 16 14:14  initramfs-6.6.30-gentoo-x86_64.img
-rwx------  1 root root 14381984 čen 15 17:35  initramfs-6.6.30-gentoo-x86_64.img.old
-rwx------  1 root root 14814208 čen 16 15:01  intel-uc.img
-rwx------  1 root root        0 čen  7 22:23  .keep
-rwx------  1 root root       68 bře 22 23:54  _SMSTSVolumeID.7159644d-f741-45d5-ab29-0ad8aa4771ca
-rwx------  1 root root  6385153 čen 16 15:05  System.map-6.6.30-gentoo-x86_64
-rwx------  1 root root  6385153 čen 16 14:03  System.map-6.6.30-gentoo-x86_64.old
drwx------  2 root root     4096 čec 11  2023 'System Volume Information'
-rwx------  1 root root 11866624 čen 16 15:05  vmlinuz-6.6.30-gentoo-x86_64
-rwx------  1 root root 11866624 čen 16 14:03  vmlinuz-6.6.30-gentoo-x86_64.old


Also, using "grub-mkconfig -o /boot/grub/grub.cfg", grub finds everything, including the Windows and Ubuntu devices and adds all.

However, when I try to boot Gentoo, the bootloader can't find the LUKS device. It also says "Could not find the root in .". Noting the empty location, I thought I'm missing the encrypted device specification somewhere, but checking it, it doesn't seem so.

Additional info:
fstab:
Code:

nomad-Precision-3581 /usr/src/linux # cat /etc/fstab
# <fs>         <mountpoint>   <type>      <opts>      <dump> <pass>

#LABEL=boot      /boot      ext4      defaults   1 2
#UUID=58e72203-57d1-4497-81ad-97655bd56494      /      xfs      defaults      0 1
#LABEL=swap      none      swap      sw      0 0
#/dev/cdrom      /mnt/cdrom   auto      noauto,ro   0 0
UUID=382F-EF6F               /boot   vfat   noauto,noatime   1 2
UUID=f5e18d0c-c705-4e59-b438-dfd9bf9a3955   /   ext4   defaults   0 1
UUID=87f3482b-2944-4922-ae74-c8c4f0b0dbdb   /home   ext4   defaults   0 1
tmpfs                  /tmp   tmpfs   size=10G   0 0


crypt root in grub.cfg:
Code:
nomad-Precision-3581 /usr/src/linux # cat /boot/grub/grub.cfg | grep crypt
   linux   /vmlinuz-6.6.30-gentoo-x86_64 root=/dev/mapper/vg1-root ro dolvm crypt_root=UUID=bf41e4ca-3e6a-47ca-8eb9-e8b8f21ef544 root_trim=yes
      linux   /vmlinuz-6.6.30-gentoo-x86_64 root=/dev/mapper/vg1-root ro dolvm crypt_root=UUID=bf41e4ca-3e6a-47ca-8eb9-e8b8f21ef544 root_trim=yes
      linux   /vmlinuz-6.6.30-gentoo-x86_64 root=/dev/mapper/vg1-root ro single dolvm crypt_root=UUID=bf41e4ca-3e6a-47ca-8eb9-e8b8f21ef544 root_trim=yes
      linux   /vmlinuz-6.6.30-gentoo-x86_64.old root=/dev/mapper/vg1-root ro dolvm crypt_root=UUID=bf41e4ca-3e6a-47ca-8eb9-e8b8f21ef544 root_trim=yes
      linux   /vmlinuz-6.6.30-gentoo-x86_64.old root=/dev/mapper/vg1-root ro single dolvm crypt_root=UUID=bf41e4ca-3e6a-47ca-8eb9-e8b8f21ef544 root_trim=yes


I've also installed lvm2 and cryptsetup:
Code:
[ebuild   R    ] sys-fs/lvm2-2.03.22-r5::gentoo  USE="lvm readline udev -sanlock (-selinux) -static -static-libs -systemd -thin -valgrind" 0 KiB
[ebuild   R    ] sys-fs/cryptsetup-2.6.1:0/12::gentoo  USE="argon2 nls openssl udev -fips -gcrypt -kernel -nettle -pwquality -ssh -static -static-libs -test -urandom" 0 KiB
... and added them to boot. List of services at runlevel boot: https://pastebin.com/nPtUmGxc

.config:
https://pastebin.com/6PwK50QN

I'm somehow out of ideas. I would appreciate some. Thanks in advance.
Back to top
View user's profile Send private message
sublogic
Apprentice
Apprentice


Joined: 21 Mar 2022
Posts: 268
Location: Pennsylvania, USA

PostPosted: Mon Jun 17, 2024 1:35 am    Post subject: Reply with quote

Since you used genkernel, I would suggest adding debug to your kernel command line in grub, to get a rescue shell. See if you can decrypt the LUKS partition, find the logical volumes and mount the root from there.

(You get three pauses to a rescue shell. Keep typing exit to continue.)
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 445

PostPosted: Mon Jun 17, 2024 4:31 pm    Post subject: Reply with quote

Are you asked for the LUKS passphrase when you boot Gentoo? Or not?

Are you using the ESP only for Gentoo as /boot or is also Ubuntu using the ESP as /boot? Can you share /boot/grub/grub.cfg?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum