# dm-crypt with LUKS - Some questions about the tutorial

## kingfame_147

Hi,

i'm on the way to switch from truecrypt to dm-crypt with luks for some reasons.

I found this great tutorial, but i've 2 problems:

- http://en.gentoo-wiki.com/wiki/DM-Crypt_with_LUKS#Decrypting.2FEncrypting_partitions_at_startup

There are some options given for the swap partion. If I put that line to my /etc/conf.d/dmcrypt i'm getting the message that those options are unknown and the line will be ignored. The swap partion is mounted, i guess with some default options. In the default /etc/conf.d/dmcrypt is the comment

```

# options='<opts>'                   == cryptsetup, for LUKS you can only use --readonly

```

Is that right? For luks there are no other options then --readonly? Is the tutorial outdated?

- mdadm - raid1

I've a raid1 with 2 discs. Booting without the "initramfs" from the tutorial everything is ok. When booting with the initramfs (and the init-file from here, as it is mentioned in the tutorial) the raid isn't working anymore. The second disc is not in the raid-array anymore after booting. I can add it with 

```
mdadm /dev/md0 --add /dev/sdd1
```

but then the raid has to resync. I've to do that after each boot, so this is no option :/

Any ideas?

Edit: dmesg says about that md thing:

```

1591-[    6.729953] md: md0 stopped.

1592-[    6.735250] md: bind<sdc1>

1593:[    6.737098] raid1: raid set md0 active with 1 out of 2 mirrors

1594-[    6.737136] md0: detected capacity change from 0 to 500105150464

1595-[    6.737337] mdadm used greatest stack depth: 3960 bytes left

1596-[    6.739266]  md0: unknown partition table

```

Btw: The fs at that raid is truecrypt encrypted, but that works fine without that initramfs. The second disc should be /dev/sdd1.

Thanks a lot for your help!

Regards,

fame

----------

## kingfame_147

For the second problem i found the reason:

http://en.gentoo-wiki.com/wiki/Initramfs#Software_RAID

I've copied my mdadm.conf and the mdadm binary to the initramfs. Then i've added the

```
mdadm --assemble --scan /dev/md0
```

line somewhere in the "init" file, but i dont know where to add. It didn't worked btw :)

----------

## kingfame_147

The second problem is gone now.

I've added 

```
busybox raidautorun /dev/md0
```

to the init-file from the initramfs (just put it somewhere at the end^^).

----------

