public inbox for cryptsetup@lists.linux.dev
 help / color / mirror / Atom feed
From: blobfish <blobfish@gmx.com>
To: cryptsetup@lists.linux.dev
Subject: Re: Looking for confirmation as I enter the acceptance stage.
Date: Fri, 28 Jul 2023 11:23:40 -0400	[thread overview]
Message-ID: <13313734.uLZWGnKmhe@laptop> (raw)
In-Reply-To: <c5d4730e-a1d3-401b-9be5-aa5311ca3166@home.arpa>

On Friday, July 28, 2023 9:17:43 AM EDT Michael Kjörling wrote:
> Unfortunately, "doesn't work" isn't very helpful. The offsets I
> mentioned previously were based on what you sent, which presumably was
> based on the partition. If for some reason the partition table isn't
> readable on the new drive, then at a minimum that means that those
> exact offsets likely no longer apply. You will need to determine how
> far into the device the initial "L" in "LUKS" in the LUKS header
> appears; then skip that many bytes when reading such that that "LUKS"
> is the very first four bytes that cryptsetup sees on the device (or in
> the file) that you give it. That was the purpose of the dd skip=X
> bs=Y; the offset was X*Y bytes.
> 
> The general idea is that once you have a copy of the drive holding the
> broken LUKS container, you can work with that copy and just make a new
> copy from the untouched original if you make a mistake; then, given
> the offset at which the header you did find begins in the copy you're
> working with, use e.g. `losetup -o N -f /dev/<something>` for that
> offset N to set up a loopback device which offsets I/O through to
> /dev/<something> (see the man page for details); then give the
> resulting /dev/loop* device to cryptsetup. From there, once cryptsetup
> successfully unlocks the container (which it should be able to, based
> on the experimentation with the smaller portion of the container), I
> believe that you should be able to mount the Btrfs file system
> normally through the symlink in /dev/mapper to whichever /dev/dm-*
> that happens to become. Once the file system is mounted, it should all
> hopefully be a perfectly normal file copy operation.

Ok, sorry for the confusion. Working with the clone, I was thrown off by parted 
complaining about the gpt table and that it (parted) didn't list any 
partitions. Also I wasn't expecting the offset to be different. As I was figuring 
out the offset for the clone, I did notice some EFI information which I am 
pretty sure was not on the original. I didn't spend a lot of time with that 
cloned drive prior to ddrescue, I might have missed the EFI partition and 
maybe ddrescue started after it and that could explain the incomplete copy?

Anyway, I have made it through and have successfully mounted my filesystem! 
First look through an looks good.

just a little more hand holding, I promise:
should I get btrfs involved before the copy? like:
  btrfs check
  btrfs check --repair
as far as the copy I was just going to 'cp -avr'. Is there a better command 
for what I am doing?




  reply	other threads:[~2023-07-28 15:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-23 22:40 Looking for confirmation as I enter the acceptance stage blobfish
2023-07-23 23:04 ` Michael Kjörling
2023-07-24  0:00   ` blobfish
2023-07-24 16:03     ` Michael Kjörling
2023-07-24 18:17       ` Michael Kjörling
2023-07-24 18:45         ` blobfish
2023-07-26 15:38       ` blobfish
2023-07-26 15:50         ` Michael Kjörling
2023-07-26 16:10           ` blobfish
2023-07-26 17:49             ` Michael Kjörling
2023-07-27 14:12               ` blobfish
2023-07-28 13:17                 ` Michael Kjörling
2023-07-28 15:23                   ` blobfish [this message]
2023-07-28 18:50                     ` Looking for confirmation as I enter the acceptance stage. -- SOLVED Michael Kjörling
2023-07-29 12:58                       ` blobfish

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=13313734.uLZWGnKmhe@laptop \
    --to=blobfish@gmx.com \
    --cc=cryptsetup@lists.linux.dev \
    /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