filesystem

Encrypted partitions with Ubuntu/Debian

I figured out how to set up an encrypted partition on Ubuntu the other day. There are a bunch of ways of doing it but I found this to be the simplest. It should work on Debian too, since all the relevant packages are Debian ones anyway. In my example I’m encrypting an LVM partition (logical volume), but it should work with any device, including removable USB keys (see end notes). UPDATE: This is broken in Edgy but I figured out a simple fix, see below.

Install the cryptsetup package from apt
# apt-get install cryptsetup
Choose a partition you’d like to encrypt.

In my case, I’m encrypting an LVM logical volume on a sata harddisk: