# Dracut initramfs fails to detect/decrypt encrypted root

## Xander314

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 

```
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

```
root=/dev/mapper/vg-root cryptdevice=/dev/sda4:crypt
```

What am I doing wrong?

----------

## cach0rr0

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

```

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

----------

## Xander314

I fixed it by adding this to the kernel command line:

```
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  :Smile: 

----------

## consus

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).

----------

## Xander314

That explains it... Thanks.

----------

