From: Arno Wagner <arno@wagner.name>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] How can a passphrase be incorrect even after `luksHeaderBackup` and `luksHeaderRestore`?
Date: Fri, 5 Aug 2011 17:08:56 +0200 [thread overview]
Message-ID: <20110805150856.GA17583@tansi.org> (raw)
In-Reply-To: <CAOOH3prtyLExiLrkyxSHVRqR7Tx6BYq4xDHiDfB3QTcjns-wiQ@mail.gmail.com>
On Fri, Aug 05, 2011 at 05:02:13PM +0200, Paul Menzel wrote:
> 2011/8/5 Milan Broz <mbroz@redhat.com>:
> > On 08/05/2011 02:11 PM, Paul Menzel wrote:
> >>> No, as from the output above, I do not see the same problem. What
> >>> could be the reason for this difference in behaviour?
> >>
> >> On #lvm Milan suggested that the problem lies with the new drive
> >> having some misalignment
> >
> > I have checked the dump and there is clear corruption of first keyslot
> > (0x1000 - 0x1400 offset).
>
> Is the key slot corruption the only corruption? So `dd`ing the part
> from the old drive to the new (corrupted) drive should have fixed the
> LUKS setup and no other metadata (LVM, ext3) should be influenced?
>
> > I'll try to find the source of problem now.
>
> Thank you for your help.
>
> I emphasize again these errors because the RAID1 was still active when
> I tried `luksOpen` and the passphrases started to be declined.
The RAID superblocks get frequently rewritten. There is an
"event-count" in there used to detect when a disk fell out
of the RAID (will have an older event counter).
This may trash the keyslot if you wrote the header to the underlying
device, not the RAID device or there is some device overlap.
In fact that explanation now sounds most likely to me.
Arno
> --- dmesg ---
> Aug 4 00:16:01 grml kernel: [ 7964.786362] device-mapper:
> table: 253:0: crypt: Device lookup failed
> Aug 4 00:16:01 grml kernel: [ 7964.786367] device-mapper:
> ioctl: error adding target to table
> Aug 4 00:16:01 grml udevd[2409]: inotify_add_watch(6,
> /dev/dm-0, 10) failed: No such file or directory
> Aug 4 00:16:01 grml udevd[2409]: inotify_add_watch(6,
> /dev/dm-0, 10) failed: No such file or directory
>
> Aug 4 00:17:14 grml kernel: [ 8038.196371] md1: detected
> capacity change from 1999886286848 to 0
> Aug 4 00:17:14 grml kernel: [ 8038.196395] md: md1 stopped.
> Aug 4 00:17:14 grml kernel: [ 8038.196407] md: unbind<sda2>
> Aug 4 00:17:14 grml kernel: [ 8038.212653] md: export_rdev(sda2)
> --- dmesg ---
>
> Additionally right after that I did `luksHeaderBackup` and the
> checksum of that file
>
> $ md5sum 20110804--new-drive--luksHeaderBackup--sda2--after-command-b
> 7b897c620776f549324810a8aeb9921e
> 20110804--new-drive--luksHeaderBackup--sda2--after-command-b
>
> is the same as when doing `luksHeaderRestore` from the old working
> drive and then `luksHeaderBackup`.
>
> # md5sum sda.header
> 7b897c620776f549324810a8aeb9921e sda.header
>
> So `luksHeaderRestore` does not seem to update it or only parts which
> were not corrupted (since the passphrase does not work with it).
>
>
> Thanks and sorry for stating the obvious,
>
> Paul
>
>
> PS: I hope, someone on linux-raid will shed some light into how the
> corruption could have happened.
>
>
> [1] http://marc.info/?l=linux-raid&m=131248606026407&w=2
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
>
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@wagner.name
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans
If it's in the news, don't worry about it. The very definition of
"news" is "something that hardly ever happens." -- Bruce Schneier
next prev parent reply other threads:[~2011-08-05 15:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-04 21:31 [dm-crypt] How can a passphrase be incorrect even after `luksHeaderBackup` and `luksHeaderRestore`? Paul Menzel
2011-08-04 23:18 ` Paul Menzel
2011-08-05 2:20 ` Milan Broz
2011-08-05 8:41 ` Paul Menzel
2011-08-05 12:11 ` Paul Menzel
2011-08-05 14:16 ` Milan Broz
2011-08-05 14:52 ` Arno Wagner
2011-08-05 14:55 ` Arno Wagner
2011-08-05 17:47 ` Milan Broz
2011-08-05 15:02 ` Paul Menzel
2011-08-05 15:08 ` Arno Wagner [this message]
2011-09-01 19:08 ` Paul Menzel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110805150856.GA17583@tansi.org \
--to=arno@wagner.name \
--cc=dm-crypt@saout.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.