public inbox for cryptsetup@lists.linux.dev
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: Darek Hisc <darek.hisc@aleeas.com>, cryptsetup@lists.linux.dev
Subject: Re: Problem after detaching the header
Date: Sat, 1 Jul 2023 09:50:22 +0200	[thread overview]
Message-ID: <baaf0d13-97a2-8846-ca4f-8f89d96ef499@gmail.com> (raw)
In-Reply-To: <168806625127.6.2008140751957055524.147127853@aleeas.com>

On 6/29/23 21:17, Darek Hisc wrote:
> Hi
> 
> I am trying to move my current included header from sda2 to a separate raw (no file system) partition of device sdb1, but after removing the original header the system does not start and stops at the initramfs console.
> 
> OS: LMDE 5 (Linux Mint Debian Edition = de facto Debian 11)
> Standard LVM installation on LUKS2
> 
> I did the following steps:
> 1. cryptsetup luksHeaderBackup /dev/sda2 --header-backup-file /header.img
> 2. dd if=/header.img of=/dev/sdb1
> 3. option luks,discard,tries=3,header=/dev/sdb1 > /etc/crypttab
> 4. update-initramfs -u -k all
> 5. cryptsetup luksErase /dev/sda2

Just a comment here:

- luksErase will destroy keyslots (key material), but still keeps LUKS
header on the device, including UUID (so you can reference the device through UUID
even if it cannot be unlocked without detached header)

- after you dd the LUKS header, UUID is of course no longer recognized, but,
as you used another device for LUKS header, the new one will have former UUID
Check that UUID is not referenced in config. (Also you can change it with
luksUUID command)

But as Arno said, this is really question for your distro (note that cryptab
file can be managed by systemd, but there are also non-systemd versions).
Also without console log it is not clear what exactly fails.

Milan

> 
> Up to this point, everything works fine and the system boots up properly
> When, according to the instructions in the https://gitlab.com/cryptsetup/cryptsetup/-/blob/main/FAQ.md I do:
> 6. cryptsetup luksDump /dev/sdb1 > Data segments: offfset: 16777216 bytes
> 7. dd bs=512 count=32768 if=/dev/zero of=/dev/sda2
> the system no longer starts.
> 
> Have I screwed something up or am I missing a step?
> Please help!
> 
> Darek
> 
> 
> 

  parent reply	other threads:[~2023-07-01  7:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 19:17 Problem after detaching the header Darek Hisc
2023-06-30  2:50 ` Arno Wagner
2023-06-30  9:04   ` Darek Hisc
2023-06-30 10:54     ` Arno Wagner
2023-07-01  7:50 ` Milan Broz [this message]
2023-07-01 17:06   ` Darek Hisc
2023-07-01 21:00     ` Milan Broz
2023-07-04 16:58       ` Darek Hisc

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=baaf0d13-97a2-8846-ca4f-8f89d96ef499@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=cryptsetup@lists.linux.dev \
    --cc=darek.hisc@aleeas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox