All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: Default User <hunguponcontent@gmail.com>, dm-crypt@saout.de
Subject: Re: [dm-crypt] Restored luks2 header to wrong drive!
Date: Tue, 5 May 2020 15:57:29 +0200	[thread overview]
Message-ID: <7ca39cd9-2c2c-ad81-82aa-860d8f3e568c@gmail.com> (raw)
In-Reply-To: <CAMaNm6GM=xJy0QfyBgPvLyuJ0-BNm+Yo9xt3ewOw1gb1TASb_Q@mail.gmail.com>

On 05/05/2020 15:39, Default User wrote:
> 
> Just a note: maybe LUKS could someday add a feature that would check
> before restoring a luks2 header, and alert the user that they are
> trying to restore to a different disk than the header was backed up
> from, or to a disk that does not appear to contain LUKS encrypted
> data.

A generic warning is there:

# cryptsetup luksHeaderRestore /dev/sdb --header-backup-file /luks-bck.img

WARNING!
========
Device /dev/sdb does not contain LUKS2 header. Replacing header can destroy data on that device.

...

Just is should say what filesystem is there (we do this check on luksFormat already):
through libblkid:

# cryptsetup luksFormat /dev/sdb
WARNING: Device /dev/sdb already contains a 'ext4' superblock signature.
...

so it is really just trivial fix.

Milan

  parent reply	other threads:[~2020-05-05 13:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05  3:07 [dm-crypt] Restored luks2 header to wrong drive! Default User
2020-05-05  9:20 ` Michael Kjörling
2020-05-05 13:39   ` Default User
2020-05-05 13:51     ` Robert Nichols
2020-05-05 13:57     ` Milan Broz [this message]
2020-05-05 14:00     ` Carlos E. R.
2020-05-05 14:33     ` Arno Wagner
2020-05-05 16:29 ` Chris Murphy
2020-05-05 16:50   ` Default User

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=7ca39cd9-2c2c-ad81-82aa-860d8f3e568c@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=dm-crypt@saout.de \
    --cc=hunguponcontent@gmail.com \
    /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.