Things not to do with lvm and crypto

At least as of june, 2007, you should never do this:

"...I need some encrypted storage space...":

lvcreate -L1G -n test vgname
cryptsetup luksFormat /dev/vgname/test
cryptsetup luksOpen /dev/vgname/test test1
mke2fs -j /dev/mapper/test1
mount /dev/mapper/test1 /mnt
# ...copy important data to /tmp...

"...oh, I need more space...":

lvresize -L+1G /dev/vgname/test
# cryptsetup resize test1 did not seem to
# work, so why not try this instead:
cryptsetup reload test1 /dev/vgname/test
resize2fs /dev/mapper/test1

Message from syslogd@localhost at Sun Jun 10 13:17:37 2007 ...

localhost kernel: journal commit I/O error

"...oh damn. What happened?":

umount /mnt
mount /dev/mapper/test1 /mnt

EXT3-fs warning (device dm-13): ext3_clear_journal_err: Filesystem error recorded from previous mount: IO failure

EXT3-fs warning (device dm-13): ext3_clear_journal_err: Marking fs in need of filesystem check.

"...let's check it then...":

umount /mnt
e2fsck /dev/mapper/test1

"...what the hell is going on?":

e2fsck -fy /dev/mapper/test1

"...$☠&☢ !☣^☄@ ☟$☹(♨Y⚔ ^⚗Q⚛!⚡ @⚠%⚰#⚱ !!!".