# cryptsetup init-script not starting, manual after boot works

## nihilist

Hi,

I'm trying to unlock my encrypted luks partition (sda7) during boot, the partition contains a lvm.

I started by emerging 

```

sys-fs/cryptsetup-1.1.3-r3

```

edited /etc/conf/dmcrypt and inserted

```

target=sda7_crypt

source='/dev/sda7'

```

and added cryptsetup  to the boot-runlevel with

```

rc-update add dmcrypt boot

```

In my /etc/fstab i have:

```

/dev/homer/var /var   ext4    noatime         0 2

/dev/homer/home         /home           ext4            noatime         0 2

/dev/homer/swap         none            swap            sw              0 0

```

to activate and mount the lvm which is inside the encrypted volume. (homer is the name of the volume group)

However, no request to enter the passphrase or any error regarding cryptsetup shows up during boot.

After finishing the boot process i can unlock the disk and mount the partitions manually with:

```

cryptsetup luksOpen /de/sda7 sda7_crypt

/etc/init.d/lvm start

mount -a

```

Any hints on how i can fix this problem?

thx   :Smile: 

Edit:

Manually starting the script /lib/rcscripts/addons/dm-crypt-start.sh which is called by /etc/init.d/dmcrypt works also...

Edit2:

Well, it seems that upgrading openrc to sys-apps/openrc-0.9.3-r1 fixed it.

I`m still curious what causes that problem though, is there any known bug or is it worth to create a report? 

(Don't know when a new version of openrc will become stable...)

----------

## mp342

Are your init scripts called with the correct order ?

cryptset then lvm

----------

## nihilist

Yes, with  both versions of openrc the boot order is 

1. dmcrypt

2. lvm

----------

## mp342

And during the boot, the init script just reports [ok] without anything else ?

----------

## nihilist

no, it shows nothing.

There is no message regarding cryptsetup, whether success or fail.

Later in the boot - process i see errors about not being able to mount /dev/homer/var, but thats obvious as the crypt-volume is not unlocked.Last edited by nihilist on Tue Sep 27, 2011 10:05 pm; edited 1 time in total

----------

## mp342

You should have at least "* Setting up dm-crypt mappings ...".

Try 'rc-status' just after the boot and watch the status of dmcrypt.

----------

## nihilist

I don't get it...

i re-emerged the "old" version of openrc to test this, rebooted and it works.

So, thanks for helping and sorry for the noise, perhaps this was a typical PEBKAC   :Embarassed: 

----------

