Re: Force recalculation of a data block checksum
From: Chris Murphy <hidden>
Date: 2016-07-24 02:16:54
On Sat, Jul 23, 2016 at 8:03 PM, Tomasz Melcer [off-list ref] wrote:
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.
Since btrfs-progs 3.17 'btrfs check --init-csum-tree' will create a whole new csum tree. -- Chris Murphy