Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dracut initramfs fails to detect/decrypt encrypted root
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
Xander314
n00b
n00b


Joined: 16 Apr 2012
Posts: 61

PostPosted: Fri Nov 09, 2012 6:37 pm    Post subject: Dracut initramfs fails to detect/decrypt encrypted root Reply with quote

I'm having a go at installing Gentoo on my laptop into an encrypted partition. I'm booting from a USB drive and the boot partition is /dev/sda4. I used Dracut to generate the initramfs (emerged with lvm and crypt in DRACUT_MODULES).

However, Dracut drops me to a rescue prompt since it fails to mount the root partition. The message it gives is
Quote:
dracut Warning: could not boot
dracut Warning: "dev/mapper/vg-root" does not exist


As far as I can see, the problem is that the initramfs is not attempting to decrypt the LUKS partition. If I decrypt it manually from the prompt with
Code:
cryptsetup luksOpen /dev/sda4 crypt
and exit the prompt, the initramfs successfully detects the LVM volumes on the partition and finishes the boot. But why doesn't the initramfs decrypt my LUKS partition automatically? It's encrypted with a password but there is not even a prompt.

My kernel command line specifies
Code:
root=/dev/mapper/vg-root cryptdevice=/dev/sda4:crypt


What am I doing wrong?
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sat Nov 10, 2012 6:24 am    Post subject: Reply with quote

dont know Dracut specifically, but with most of the initramfs tools ive seen, the kernel command line had to be something like

Code:

root=/dev/ram0 real_root=/dev/mapper/vg-root cryptdevice=/dev/sda4:crypt


shot in the dark. again, dont know specifics about Dracut. It could well be the initramfs is confused as to whether it's lvm atop dmcrypt, or dmcrypt atop luks. Could even be lack of devtmpfs. Dunno

If you otherwise get stuck, or if you want to pick apart the generated initramfs and compare, I put together this which might help
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Xander314
n00b
n00b


Joined: 16 Apr 2012
Posts: 61

PostPosted: Sat Nov 17, 2012 9:54 am    Post subject: Reply with quote

I fixed it by adding this to the kernel command line:
Code:
rd.luks.uuid=<UUID of /dev/sda4>


I don't know why this is necessary since the initramfs is supposed to find LUKS volumes automatically, but it appears to have worked nonetheless.

Thanks for your help :)
Back to top
View user's profile Send private message
consus
n00b
n00b


Joined: 27 Aug 2012
Posts: 38

PostPosted: Sat Nov 17, 2012 8:37 pm    Post subject: Reply with quote

commit e064127729af69c5147a0e91eb9147124340004d
Author: Harald Hoyer <harald@redhat.com>
Date: Thu Sep 27 14:05:50 2012 +0200

add "rd.auto" parameter and switch off automatic assembly

No automatic assembly is done anymore by default. You will have to
specify exactly what devices to assemble
("rd.md.uuid=" "rd.luks.uuid" ...)
or use "rd.auto=1" or "rd.auto" on the kernel command line.

For big servers with thousands of disks we don't want to assemble
everything by default (error prone, slow).
Back to top
View user's profile Send private message
Xander314
n00b
n00b


Joined: 16 Apr 2012
Posts: 61

PostPosted: Sat Nov 24, 2012 9:39 pm    Post subject: Reply with quote

That explains it... Thanks.
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