All you need to know is found here http://deb.riseup.net/storage/encryption/dmcrypt/
Comments
Code executed:
aptitude install dmsetup cryptsetup
lvcreate -L 1G -n crypt vg
cryptsetup -y create private /dev/mapper/vg0-crypt
mkfs -t xfs /dev/mapper/private
mkdir /mnt/private
Two new scripts (I do not want the partition automounted):
mount_private:
#!/bin/bash
if [ -b /dev/mapper/private ]; then
cryptsetup remove private
fi
cryptsetup create private /dev/mapper/vg0-crypt
mount -t xfs /dev/mapper/private /mnt/private
umount_private:
#!/bin/bash
umount /mnt/private
cryptsetup remove private