[Pkg-cryptsetup-devel] Bug#428288: Attempting to reload a luks partition can trash it

Enrico Zini enrico at debian.org
Sun Jun 10 12:47:54 UTC 2007


Package: cryptsetup
Version: 2:1.0.4+svn26-1
Severity: normal

Hello,

thanks for maintaining cryptsetup.

I had a major data loss that involved cryptsetup.  Luckily I had most
things backupped.

This is how I lost my entire home directory:

  http://www.enricozini.org/2007/tips/things-not-to-do.html

I reproduced the data loss on a test lvm partition using the sequence of
commands in the blog entry, which I'll repeat here in short:

  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 /mntlvresize -L+1G /dev/vgname/test
  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
  umount /mnt
  e2fsck -fy /dev/mapper/test1

I surely did something wrong, but I still don't know exactly what.

I figure that somewhere in that process (around crypysetup reload,
probably) there should be some sanity check and a loud error message.


Ciao,

Enrico

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.21-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages cryptsetup depends on:
ii  dmsetup  2:1.02.08-1                     The Linux Kernel Device Mapper use
ii  libc6    2.5-9                           GNU C Library: Shared libraries
ii  libdevma 2:1.02.08-1                     The Linux Kernel Device Mapper use
ii  libgcryp 1.2.4-2                         LGPL Crypto library - runtime libr
ii  libgpg-e 1.4-2                           library for common error values an
ii  libpopt0 1.10-3                          lib for parsing cmdline parameters
ii  libuuid1 1.39+1.40-WIP-2006.11.14+dfsg-2 universally unique id library

cryptsetup recommends no packages.

-- no debconf information




More information about the Pkg-cryptsetup-devel mailing list