Fedora15 - Help me understand how cryptsetup and LVM interact

LVM is a container for volumes ("logical" volumes, as it were). After your volume groups are enabled, these volumes are exposed at /dev/mapper and function like block devices (/dev/sda, etc). You can format them, then mount them, etc. If the underlying real devices are disconnected, the exposed "device(s)" at /dev/mapper fails to work.

In summary,

  • LVM can use any block device as a physical volume, including anything in /dev/mapper such as an encrypted LUKS volume cryptsetup exposes there.

  • cryptsetup can use any block device as an encrypted volume, including anything in /dev/mapper, such as a logical volume setup by LVM.

You have to tear things down in the reverse order you set them up. Therefore, if you have an LVM, and then an encrypted volume "in" it, you need to dismount the encrypted volume before disabling the logical volume.

(Yes, you can have an absolutely insane stack of LV's and encrypted volumes, and LV's in encrypted volumes in other LV's, etc. Gets better when you throw in network block devices, iSCSI targets, etc.)