For my new work notebook I am aiming for a setup with Debian and Gentoo side by side. I installed Gentoo first and went for adding Debian today. For a notebook I want full disk encyrption of course and my plans were to use one big dm-crypt container for everything except /boot.
Interestingly, the installer of Debian testing/wheezy does not support installing into an existing crypt container out of the box, not even when run in expert mode.
It is actually possible to reuse existing encrypted LVM volumes by following
the procedure documented on  just before starting the partitioner.
The hint about “before starting the partitioner” is the most helpful bit about it. The guide he points to is not specific to the Debian installer, misses to mention vgscan and is an immutable page so i cannot improve it easily.
To summarize, this is what worked for me (no warrenties!):
- When it comes to disk partitioning before picking “manual” switch to another terminal, e.g. <Ctrl>+<Alt>+<F2>, <Return>.
- Open the Luks container using cryptsetup luksOpen /dev/foo foo_crypt
- Run vgscan to detect the LVM volume group inside (lvdisplay alone will not do)
- Run vgchange -a y foo_crypt to activate all logical volumes
- Switch back to the installer terminal by pressing <Ctrl>+<Alt>+<F1> (which will list LVM your current LVM volumes now)
- Follow the installtion as usual but stop before rebooting
- On the second shell edit /etc/crypttab to have a line “/dev/foo foo_crypt none hash=sha1″ so the cryptcontainer is actually opened by the initramfs. Rather than “sha1″ you may want to pick whatever cryptsetup luksDump /dev/foo | fgrep -i hash produced.
Got any corrections or extensions to this post? Please comment below.
The Installing Debian to an existing dm-crypt container by Sebastian Pipping, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.