Installing Debian 9 on existing LUKS/LVM drive
I have an existing Ubuntu installation paritioned like this:
sda1 ext4 /boot
sda2 luks crypt
---- crypt pv for lvm with group root
---- ---- lvm root
---- ---- ---- root ext4 /
---- ---- ---- swap swap
---- ---- ---- home ext4 /home
Now I wanted to install Debian on this instead but not overwrite the contents of /home
With Ubuntu I'd boot up a live CD run cryptsetup
to open the luks partition then run the \
installer and everything would be fine.
For some reason the debian installer doesn't contain cryptsetup
and the Live CD you can't run the
installer from. This poses a problem.
The Execute Shell
option of the installer drops to busybox with no cryptsetup
or apt
available.
The installer does prompt to create luks volumes but for some reason doesn't prompt to open them.
The only solution I've found is to use the network install image
which has an option to enter a Rescue System
this allows you to run apt
and cryptsetup
.
Once installed you need to enter a shell in the new debian root and make sure /etc/crypttab
exists
and contains something like this:
crypt_root UUID=cd2bfe11-c527-41c3-88bd-22a2838ba456 none luks
Then run update-initramfs
this will ensure the kernel prompts to decrypt the luks device on boot.