4

A large, USB-connected HDD with btrfs contains a 1TB file (a disk image). The first btrfs scrub after writing that file found 3 logical bad blocks developed somewhere in the middle of that file:

[ 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

No backups for this file, so no perfect recovery possible. 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 (unrecoverable) or an incorrect checksum is stored (fix should be simple: recompute the checksum). Given that the first case is already lost, how can I ask btrfs to recompute the checksum of a data block?

2
  • Scrubbing might do the job. Jul 24, 2016 at 9:51
  • this may not help much, but I have had a lot of troubles with btrfs on USB.
    – dominix
    Dec 3, 2022 at 21:18

0

You must log in to answer this question.

Browse other questions tagged .