# [solved] DMcrypt and LVM not working at boot

## GenProm

Hi

I cant manage to get lvm and dmcrypt to work at boot......

Background:

I installed Gentoo on an SSD with out var and home and a data partition.

Var, home and the data partition are on the other hdd i got myself.

I did put home and my data in an lvm so i have to enter the password only once. the partition with var is not encrypted.

My Layout:

sda1 (ssd) /

sdb1 (hdd) (luks_encrypted ->lvm) home and data in volumegroups

sdb2 (hdd) var

What should happen:

LVM schould ask for password and decrypt partition and volume group fstab schould mount.

What does happen:

Lots of errors at boot time...., not asked for password.

I can open the partition from hand but somehow the volume groups are not displayed so i can mount them.....

I think this is part of the problem.

Some Info:

LVM:

 *Quote:*   

> 
> 
> Pyh volume name of LVM: lukslvm
> 
> Volume group: vgprivate
> ...

 

fstab:

 *Quote:*   

> 
> 
> /dev/sda1		/		ext4		noatime		0 1
> 
> /dev/sdb3		none		swap		sw		0 0
> ...

 

conf.d/dmcrypt

 *Quote:*   

> 
> 
> target=crypthome
> 
> source='/dev/mapper/vgprivate-home'
> ...

 

Some of the errors at boot say they cant find the vgprivate.... groups, this is logical then the partition is still encrypted and i did not get asked for password.

Also as mentioned above, i think part of the problem is, that when i decrypt manualy, the volume groups get not created....

UPDATE: I can solve this by activating the volume goups after unlocking the partition.

How can this be done on boot time ?

Also i did ad dmcrypt to boot runlevel. I guess it boils down how to activate the volume groups at boot and why im not asked to put in my password.... 

I did lvm encryption a long time ago on Ubuntu but it seems stuff in gentoo is quite different.

Oh i tried to use a /etc/crypttab without succes....

As aslways if you need mire info just ask for it....

Any help would be greatly appreacheated.

Thanks

M.

----------

## Veldrin

there seems to be a misunderstanding of which part belongs where. 

Is it correct, that you encrypted the entire lvm container, and not lv?

if that is the case your dmcypt should show something like

```
target=lukslvm

source=/dev/sdb1
```

/dev/mapper/lukslvm will then be the source device for your lvm setup. (I do not know lvm, therefore i cannot be of help).

how did you end up with that fstab?

V.

----------

## GenProm

Hi

Thanks, this solved the one problem of not get asked about the password.

The other problem i have is that the volume groups are deativated and for this reason not created and so on found by fstab....

Does somebody know how to activate the volume groups on boot ?

I did follow a guide on the net where one guy was encrypting this home and tmp in an lvm so it was pretty close to my approach. Also a used the stage3 fstab and did my changes...

Thanks for the quick help  :Smile: 

----------

## Veldrin

rc-update add lvm boot?

----------

## GenProm

Thanks this did the trick!

You made my day  :Smile: 

----------

