linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Force recalculation of a data block checksum
@ 2016-07-24  2:03 Tomasz Melcer
  2016-07-24  2:16 ` Chris Murphy
  2016-07-24  2:36 ` Duncan
  0 siblings, 2 replies; 8+ messages in thread
From: Tomasz Melcer @ 2016-07-24  2:03 UTC (permalink / raw)
  To: linux-btrfs

Hi,

I've got a USB-connected HDD with a btrfs partition. The partition 
contains a 1TB file, a disk image. The first `btrfs scrub` after writing 
that file found 3 logical bad blocks that developed somewhere in the 
middle of that file (logs below).

The full area of the btrfs partition can be read without I/O error, so I 
think there are two possible cases: either the data block was written 
incorrectly or an incorrect checksum is stored. The first case is 
obviously unrecoverable, but if it's the second case, fixing the problem 
should be as simple as recomputing the checksum for what is already stored.

How can I ask btrfs to recompute the checksum of a data block as it is 
stored on the drive? I don't see any command doing an operation like 
that, and I couldn't find anything on the topic on the internet.

Thanks,


Logs:

#v+
[ 7702.964265] BTRFS warning (device sdd1): checksum error at logical
5473719291904 on dev /dev/sdd1, sector 222940168, root 5, inode 1245769,
offset 97110921216, length 4096, links 1 (path: dysk/dysk.bin)
[ 7702.964274] BTRFS error (device sdd1): bdev /dev/sdd1 errs: wr 0,
rd 0, flush 0, corrupt 17, gen 0
[ 7702.964278] BTRFS error (device sdd1): unable to fixup (regular) 
error at logical 5473719291904 on dev /dev/sdd1
[…]
[ 9588.625906] BTRFS warning (device sdd1): checksum error at logical
5241172611072 on dev /dev/sdd1, sector 691494312, root 5, inode 1245769,
offset 310632271872, length 4096, links 1 (path: dysk/dysk.bin)
[ 9588.625916] BTRFS error (device sdd1): bdev /dev/sdd1 errs: wr 0,
rd 0, flush 0, corrupt 18, gen 0
[ 9588.625920] BTRFS error (device sdd1): unable to fixup (regular) 
error at logical 5241172611072 on dev /dev/sdd1
[…]
[20545.302898] BTRFS warning (device sdd1): checksum error at logical
3991747321856 on dev /dev/sdd1, sector 3185809200, root 5, inode 
1245769, offset 907925676032, length 4096, links 1 (path: dysk/dysk.bin)
[20545.302908] BTRFS error (device sdd1): bdev /dev/sdd1 errs: wr 0,
rd 0, flush 0, corrupt 19, gen 0
[20545.302912] BTRFS error (device sdd1): unable to fixup (regular) 
error at logical 3991747321856 on dev /dev/sdd1
#v-


-- 
Tomasz Melcer

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-07-26  1:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-07-24  5:57     ` Chris Murphy
2016-07-24  2:36 ` Duncan
2016-07-24  2:51   ` Chris Murphy

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