linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Melcer <liori@exroot.org>
To: Andrei Borzenkov <arvidjaar@gmail.com>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Force recalculation of a data block checksum
Date: Tue, 26 Jul 2016 03:50:58 +0200	[thread overview]
Message-ID: <2e73284c-797a-5322-3640-5bf65400c04f@exroot.org> (raw)
In-Reply-To: <818f5843-20ad-2a9e-9b88-a16689739c80@gmail.com>

On 24.07.2016 07:07, Andrei Borzenkov wrote:
> 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

Thank you for the one-liner, I thought of doing it myself before, but 
when I tried to figure out which numbers mean what in scrub messages, I 
got a bit lost.

However, this one-liner doesn't seem to work here; `dd` prints:

#v+
8+0 records in
8+0 records out
4096 bytes (4.1 kB) copied, 5.2857e-05 s, 77.5 MB/s
dd: writing to ‘/media/liori/USB/dysk/dysk.bin’: Input/output error
1+0 records in
0+0 records out
0 bytes (0 B) copied, 0.00364222 s, 0.0 kB/s
#v-


I'm not sure what would this message mean in this case. Is btrfs reading 
the block before writing? Maybe some block blacklist stored somewhere (I 
see that the corruption counter in scrub messages go up even if it 
reports the same errors in subsequent runs)?


> 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.

Some of the files stored in this `dysk/dysk.bin` disk image have some 
internal checksums (zip archives, etc.). That includes the ones hit by 
the checksum error. I'll try verifying these later.



-- 
Tomasz Melcer

  reply	other threads:[~2016-07-26  1:51 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
2016-07-26  1:50       ` Tomasz Melcer [this message]
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=2e73284c-797a-5322-3640-5bf65400c04f@exroot.org \
    --to=liori@exroot.org \
    --cc=arvidjaar@gmail.com \
    --cc=linux-btrfs@vger.kernel.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).