Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] dracut cannot decrypt LUKS LVM but boots fine
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
kind_gentooman
n00b
n00b


Joined: 16 Jul 2024
Posts: 7

PostPosted: Thu Jul 18, 2024 2:59 pm    Post subject: [SOLVED] dracut cannot decrypt LUKS LVM but boots fine Reply with quote

I get this error on boot:

Code:
dracut Warning: Could not boot.
dracut Warning: /dev/mapper/gentoovm-root does not exist


and then I'm dropped in a dracut shell. I run these commands:

Code:
dracut:/# cryptsetup luksOpen /dev/nvmXXXp2 gentoovm --key-file /boot/volume.key
dracut:/# exit


Upon exiting, the system detects everything and boots pefectly. So it's not performing the luksOpen.

Code:

/dev/nvmXXXp1  is /boot/efi/
/dev/nvmXXXp2:  1234
gentoovm: 9999
gentoovm-root 0000

/etc/default/grub:
GRUB_CMDLINE_DEFAULT="root=UUID=0000 rd.luks.uuid=1234 rd.lvm.vg=gentoovm"

/etc/dracut.conf.d/10-crypt.conf:
install_items+=" /boot/volume.key /etc/crypttab "
add_dracutmodules+=" lvm crypt dm "

/etc/crypttab:
gentoovm UUID=1234 /boot/volume.key luks

/etc/portage/package.use:
sys-fs/lvm2 lvm
sys-boot/grub:2 device-mapper


Additionally I ran
Code:
rc-update add lvm boot


what am I doing wrong?


Last edited by kind_gentooman on Sun Jul 21, 2024 8:06 am; edited 2 times in total
Back to top
View user's profile Send private message
wanne32
n00b
n00b


Joined: 11 Nov 2023
Posts: 69

PostPosted: Thu Jul 18, 2024 4:59 pm    Post subject: Reply with quote

I assume same problem as here: https://forums.gentoo.org/viewtopic-t-1169994-highlight-.html
The --install "/boot/volume.key /etc/crypttab" still works. But I assume that it will still have other problems. Since dracut is now (like systemd) ignoring most of the time the crypttab entirely.
Back to top
View user's profile Send private message
kind_gentooman
n00b
n00b


Joined: 16 Jul 2024
Posts: 7

PostPosted: Sat Jul 20, 2024 1:58 pm    Post subject: Reply with quote

thanks a lot, I'm trying UGRD now but it's hard to find info on the format for using a key-file

Code:

modules = [
"ugrd.kmod.standard_mask",
"ugrd.crypto.cryptsetup",
"ugrd.fs.lvm",
]

kmod_autodetect_lspci = true
kmod_autodetect_lsmod = true

[cryptsetup.gentoovm]
uuid = "..."
key_file = "/boot/volume.key"

[copies.key]
source = "/boot/volume.key"
destination = "/boot/volume.key"


This is as far as I got, but it's wrong. I'm not sure where to go from here.
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 490

PostPosted: Sat Jul 20, 2024 3:29 pm    Post subject: Reply with quote

Is your key-file on an unencrypted device?
Back to top
View user's profile Send private message
kind_gentooman
n00b
n00b


Joined: 16 Jul 2024
Posts: 7

PostPosted: Sat Jul 20, 2024 5:23 pm    Post subject: Reply with quote

I use grub to decrypt the hard disk, but the initramfs needs to remount as root. So then I add the key file to luks.

See

https://docs.voidlinux.org/installation/guides/fde.html
Back to top
View user's profile Send private message
kind_gentooman
n00b
n00b


Joined: 16 Jul 2024
Posts: 7

PostPosted: Sat Jul 20, 2024 6:44 pm    Post subject: Reply with quote

OK guys finally got this working, see this thread

https://github.com/desultory/ugrd/issues/21
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 490

PostPosted: Sun Jul 21, 2024 7:58 am    Post subject: Reply with quote

kind_gentooman wrote:
I use grub to decrypt the hard disk, but the initramfs needs to remount as root. So then I add the key file to luks.

See

https://docs.voidlinux.org/installation/guides/fde.html


In the linked guide the ESP is mounted to /boot/efi. And your infos in the first post show that the first partition is mounted to /boot. Assuming that the first partition is the ESP then your initramfs and /boot/volume.key are not encrypted whereas in the linked guide the initramfs and key are encrypted because they reside on the encrypted /.
Back to top
View user's profile Send private message
kind_gentooman
n00b
n00b


Joined: 16 Jul 2024
Posts: 7

PostPosted: Sun Jul 21, 2024 8:05 am    Post subject: Reply with quote

Thanks I made a typo and corrected it.

first partition is /boot/efi/ which is FAT. /boot is on / and is encrypted
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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