Installing Debian on existing encrypted lvm

3

I have a dual-boot machine, where I already set up Ubuntu in an encrypted lvm. I want to use the same lvm for Crunchbang (a debian derivative), since I designed that lvm with two root-Volumes, a swap-area and a data-volume.

I managed to get the lvm mounted in the Debian-installer (through the shell with cryptsetup and vgchange - that seemed the only possible way, since partman seems not able to do so on it's own) and I could install Crunchbang doing that.

Now the only proble I am having now is, that my Debian is not finding the lvm-group (thus not the root-Volume) - which seems only logical, because apparently it does not know it is behind an encrypted partition.

So the question is: How do I get my Debian to work now?

It seems to me that the bootloader (grub in this case) just does not know about the encryption, so if I could get it to know about it, everything would work fine. How would I achieve that?

Or - to be more to the thread-question - is there another (simpler) way of installing a Debian system onto an existing encrypted lvm?

alex

Posted 2012-11-24T12:01:05.927

Reputation: 649

Answers

4

Better late than never, a solution for installing Linux system using Debian installer to an already LUKS encrypted LVM volume group: https://dragonvslinux.wordpress.com/2017/09/24/installing-debian-9-kali-2-0-to-an-already-luks-encrypted-lvm-volume-group/

Five years later and this is still an issue it seems. For reference sake, Debian didn't find the LVM group as you wouldn't of had a crypttab file created and integrated into initramfs (step 9 of above link) which is part of the deal when selecting previously configured LVMs.

DragonvsLinux

Posted 2012-11-24T12:01:05.927

Reputation: 41

1Consider adding some quoted reference to this answer supporting what you state in case the link ever dies so the answer content is still available that is currently only available via that link per your suggestion. – Pimp Juice IT – 2017-09-25T11:52:00.620

0

After much fiddling, I haven't found a way to restore my os. However I have found a way on how to install both OS's correctly:

First of all, there are (quite naturally) differences in the packages the debian-installer comes with, depending on the OS you want to install. This is pretty much the bottle-neck of the problem here:

In my case - ever since Canonical decided they wouldn't release an alternate cd for 12.10 and up anymore, thus leaving users with ubiquity, that is incapable of setting up a non-trivial partitioning scheme -, the alternate (i.e. debain-)installer of Ubuntu's 12.04 lts was able to detect encrypted drives and configured lvm's, while Crunchbang's debian-installer was not.

So my steps were:

  • Install Crunchbang first
  • Set up different partitions, one of them an encrypted one
  • (Here is another tricky part: The default encryption algorithm in Crunchbang was, I think, aes-xts-plain64, that however was not supported by the Ubuntu 12.04 installer) Choose an encryption algorithm that is supported by both OS's Debian-Installers
  • Install Crunchbang on one of the Volumes of the encrypted lvm
  • Install Ubuntu
  • In the partition manager, click on "Set up encrypted partition". The installer will ask if you want to finalize the partition scheme, click yes (it is already final), and then it will ask if you want to discover encrypted drives, click yes
  • If everything went well, you may pass in your passphrase for the partition and the installer will already list the available Volumes
  • Install Ubuntu on one of the Volumes of the encrypted lvm
  • Enjoy!

Now these steps were specific to my OS's, so may vary a lot to whatever someone else wants to install, but should in general give an idea on how to proceed.

One last friendly advice: Use a Virtual Machine (e.g. VirtualBox) before attempting such an installation. It will save you a lot of hairloss and will increase your productivity!

alex

Posted 2012-11-24T12:01:05.927

Reputation: 649