Re: Force recalculation of a data block checksum

2016-07-25 Thread Tomasz Melcer
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

Re: Force recalculation of a data block checksum

2016-07-23 Thread Chris Murphy
On Sat, Jul 23, 2016 at 10:32 PM, Tomasz Melcer wrote: > On 24.07.2016 04:16, Chris Murphy wrote: >> >> On Sat, Jul 23, 2016 at 8:03 PM, Tomasz Melcer wrote: >>> >>> How can I ask btrfs to recompute the checksum of a data block as it is >>> stored on the

Re: Force recalculation of a data block checksum

2016-07-23 Thread Andrei Borzenkov
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 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

Re: Force recalculation of a data block checksum

2016-07-23 Thread Tomasz Melcer
On 24.07.2016 04:16, Chris Murphy wrote: On Sat, Jul 23, 2016 at 8:03 PM, Tomasz Melcer 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

Re: Force recalculation of a data block checksum

2016-07-23 Thread Chris Murphy
The negative of --init-csum-tree is that it's going to work on all data extents. It's going to take a while. It's probably faster to extract the suspect file with restore onto another file system and check its integrity by other means (compare to backup, database integrity check, etc). -- Chris

Re: Force recalculation of a data block checksum

2016-07-23 Thread Duncan
Tomasz Melcer posted on Sun, 24 Jul 2016 04:03:08 +0200 as excerpted: > 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. There's no

Re: Force recalculation of a data block checksum

2016-07-23 Thread Chris Murphy
On Sat, Jul 23, 2016 at 8:03 PM, Tomasz Melcer 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

Force recalculation of a data block checksum

2016-07-23 Thread Tomasz Melcer
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