DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] dm-crypt hanging on attempts to manipulate an encrypted device
Date: Sun, 18 Apr 2010 21:53:35 +0200	[thread overview]
Message-ID: <4BCB633F.5000609@redhat.com> (raw)
In-Reply-To: <4BCB0579.5030600@redhat.com>

On 04/18/2010 03:13 PM, Milan Broz wrote:
> On 04/18/2010 01:17 PM, Pedro Fernandes Macedo wrote:
>> I have a 1TB USB disk that I use for backups and has recently hit a
>> snag.  The encrypted device was working fine, but it now is failing on a
>> weird way: after plugging it in yesterday and doing a luksOpen,
>> the "automatic header conversion from 0.99 to 0.991 triggered" message
>> appeared. After that, every single attempt at opening the device or add
>> keys hangs after the key is entered. This is a device that was in use
>> all the time and was working until I unplugged it (for safety) for some
>> changes to my raid setup. 
> 
> The automatic upgrade of version indicates that header was created
> with old version of cryptsetup...

For the archive:

seems that it was really unexpected result of automatic update.
("update" is basically conversion of iteration count into network byte order
- big/little endian conversion + some other magic.)

Because master key header digest iteration was always 10 in that problematic
version of cryptsetup, where device was originally formatted, recovery was quite easy.

I removed this automatic update in cryptsetup 1.1.0 (it was not safe as this report
proved), but because it seems that still there is possibility that old metadata
version exists, I'll add some workaround to luksHeaderRestore command.

So in future, general procedure to "update & fix" incompabilities is to perform

crypsetup luksHeaderBackup --header-backup-file <file> <device>
crypsetup luksHeaderRestore --header-backup-file <file> <device>

(currently it wipes possible FS signatures, which can be between header
and keyslots - also known problem with previous metadata handler.)

Milan

      parent reply	other threads:[~2010-04-18 19:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-18 11:17 [dm-crypt] dm-crypt hanging on attempts to manipulate an encrypted device Pedro Fernandes Macedo
2010-04-18 13:13 ` Milan Broz
2010-04-18 14:21   ` Pedro Fernandes Macedo
2010-04-18 19:53   ` Milan Broz [this message]

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=4BCB633F.5000609@redhat.com \
    --to=mbroz@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox