linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Tomasz Melcer <liori@exroot.org>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Force recalculation of a data block checksum
Date: Sun, 24 Jul 2016 08:07:50 +0300	[thread overview]
Message-ID: <818f5843-20ad-2a9e-9b88-a16689739c80@gmail.com> (raw)
In-Reply-To: <6699a315-17f4-9298-fb6b-64358c497be0@exroot.org>

24.07.2016 07:32, Tomasz Melcer пишет:
> On 24.07.2016 04:16, Chris Murphy wrote:
>> On Sat, Jul 23, 2016 at 8:03 PM, Tomasz Melcer <liori@exroot.org> wrote:
>>> How can I ask btrfs to recompute the checksum of a data block as it is
>>> stored on the drive?
>>
>> Since btrfs-progs 3.17 'btrfs check --init-csum-tree' will create a
>> whole new csum tree.
> 
> I can't make this command recalculate only checksum of that single file?
> 
> 

Rewriting single block in question should do it. As you can read from
raw device and have both physical and logical block address something like

dd if=/dev/sdd1 skip=222940168 count=8 | dd of=/path/to/dysk/dysk.bin
seek=189669768 conv=notrunc count=8

If you have possibility to verify file content(s), this technique can be
used to read over unreadable parts of file by combining multiple dd's
from file and device.

It probably makes sense to create (read-only) snapshot to make sure you
have old content available.

  reply	other threads:[~2016-07-24  5:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-24  2:03 Force recalculation of a data block checksum Tomasz Melcer
2016-07-24  2:16 ` Chris Murphy
2016-07-24  4:32   ` Tomasz Melcer
2016-07-24  5:07     ` Andrei Borzenkov [this message]
2016-07-26  1:50       ` Tomasz Melcer
2016-07-24  5:57     ` Chris Murphy
2016-07-24  2:36 ` Duncan
2016-07-24  2:51   ` Chris Murphy

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=818f5843-20ad-2a9e-9b88-a16689739c80@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=liori@exroot.org \
    /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;
as well as URLs for NNTP newsgroup(s).