cryptsetup

How to access encrypted volumes from live CDs

Once you have decided to encrypt your hard drive, you might find yourself in the situation where you need to pull off data from it when the regular decryption mechanisms you use are not in place. E.g. when the OS is not booting or the drive has some physical problems. In that case you need to boot from a CD/DVD that supports the encryption technology that you used. In my case I need a live Ubuntu CD/DVD, preferably the same version that was used to encrypt the disk! Otherwise there might be incompatibilities:
sudo apt-get install lvm2 cryptsetup

cryptsetup

I switched already quite a while ago from the old cryptoloop technology to the newer cryptsetup technology. However, I still forget how to manually create and mount encrypted volumes, because I do this rarely. Here are the commands:
cryptsetup create cryptovolume /dev/mapper/logical_volume
mount /dev/mapper/cryptovolume /mountpoint

In this case I mapped a logical volume, but of course you can map physical volumes, too:
cryptsetup create cryptovolume /dev/sdb1
mount /dev/mapper/cryptovolume /mountpoint