Saturday, October 2, 2010

Mounting an encrypted LUKS LVM volume from a live CD

Get Luks and dm-crypt running on the live disk:
sudo apt-get install lvm2 cryptsetup
sudo modprobe dm-crypt
sudo cryptsetup luksOpen /dev/sda4 crypt1

If you LVM setup then you need to continue with:
sudo vgscan --mknodes
sudo vgchange -ay
Take note of the volume group name. 'vg0' in my case.

Mount the disk:
sudo mkdir /mnt/disk
sudo mount /dev/vg0/root /mnt/disk