Next Previous Contents

4. Using dm-crypt with LVM

4.1 Possibilities

There are the following possibilities for using dm-crypt with LVM:

The first one, creates a LVM partition and then creates a dm-crypt device linked to the LVM partition.
With this solution, you need a dm-crypt device for each LVM partition, which means entering the passphrase for each crypted partition.
This solution has been reported to work, but I haven't tryed it.

The second one, creates a dm-crypt partition and then creates one or more LVM partitions.
With this solution, you need only one dm-crypt device for more LVM partitions, which means entering the passphrase only once.
This is the only solution described in my document.

4.2 Enabling LVM over dm-crypt

By default, it's not allowed to create a LVM partition on a device mapper. This means, by default it's not possibile to create a LVM partition on a dm-crypt device.

To enable LVM over dm-crypt, just add such a line to your /etc/lvm/lvm.conf:

types = [ "device-mapper", 16 ]

If this file is missing, you can create one with the following command:

lvm dumpconfig > /etc/lvm/lvm.conf


Next Previous Contents