Btrfs srub errors


#1

Hello,

I haven’t run btrfs scrub on /.
When I run it today I found these unpleasant surprises:

btrfs device stats
btrfs device stats /
[/dev/mmcblk0p1].write_io_errs    0
[/dev/mmcblk0p1].read_io_errs     0
[/dev/mmcblk0p1].flush_io_errs    0
[/dev/mmcblk0p1].corruption_errs  15
[/dev/mmcblk0p1].generation_errs  0

Files/blocks impacted:

dmesg after scrub
[309593.979421] BTRFS warning (device mmcblk0p1): checksum error at logical 4911104 on dev /dev/mmcblk0p1, sector 9592, root 258, inode 261, offset 667648, length 4096, links 1 (path: boot/zImage-4.4.13-1-05df79f63527051ea0071350f86faf76-7)
[309593.979436] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0
[309593.989366] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 4911104 on dev /dev/mmcblk0p1
[309600.766713] BTRFS warning (device mmcblk0p1): checksum error at logical 45776896 on dev /dev/mmcblk0p1, sector 89408, root 258, inode 924, offset 622592, length 4096, links 1 (path: usr/lib/libpython2.7.so.1.0)
[309600.766719] BTRFS warning (device mmcblk0p1): checksum error at logical 48467968 on dev /dev/mmcblk0p1, sector 94664, root 258, inode 928, offset 1323008, length 4096, links 1 (path: usr/lib/libavcodec.so.56.41.100)
[309600.766735] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 2, gen 0
[309600.766739] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 3, gen 0
[309600.766744] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 45776896 on dev /dev/mmcblk0p1
[309600.797429] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 48467968 on dev /dev/mmcblk0p1
[309601.608099] BTRFS warning (device mmcblk0p1): checksum error at logical 71233536 on dev /dev/mmcblk0p1, sector 139128, root 258, inode 1515, offset 987136, length 4096, links 1 (path: usr/lib/libcrypto.so.1.0.0)
[309601.608115] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 4, gen 0
[309601.617997] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 71233536 on dev /dev/mmcblk0p1
[309602.628181] BTRFS warning (device mmcblk0p1): checksum error at logical 82255872 on dev /dev/mmcblk0p1, sector 160656, root 258, inode 2090, offset 8192, length 1625, links 1 (path: usr/lib/python2.7/email/utils.py)
[309602.628202] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 5, gen 0
[309602.638158] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 82255872 on dev /dev/mmcblk0p1
[309602.770648] BTRFS warning (device mmcblk0p1): checksum error at logical 100507648 on dev /dev/mmcblk0p1, sector 196304: metadata leaf (level 0) in tree 55369728
[309602.770658] BTRFS warning (device mmcblk0p1): checksum error at logical 100507648 on dev /dev/mmcblk0p1, sector 196304: metadata leaf (level 0) in tree 55369728
[309602.770666] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 6, gen 0
[309602.780556] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 100507648 on dev /dev/mmcblk0p1
[309602.954010] BTRFS warning (device mmcblk0p1): checksum error at logical 98557952 on dev /dev/mmcblk0p1, sector 192496, root 258, inode 5967, offset 8192, length 4096, links 1 (path: lib/modules/4.4.13-05df79f63527051ea0071350f86faf76-7/snd-timer.ko)
[309602.954017] BTRFS warning (device mmcblk0p1): checksum error at logical 98848768 on dev /dev/mmcblk0p1, sector 193064, root 258, inode 5987, offset 12288, length 4096, links 1 (path: lib/modules/4.4.13-05df79f63527051ea0071350f86faf76-7/des_generic.ko)
[309602.954036] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 8, gen 0
[309602.954040] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 98848768 on dev /dev/mmcblk0p1
[309602.974726] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 98557952 on dev /dev/mmcblk0p1
[309602.991212] BTRFS warning (device mmcblk0p1): checksum error at logical 98852864 on dev /dev/mmcblk0p1, sector 193072, root 258, inode 5987, offset 16384, length 4096, links 1 (path: lib/modules/4.4.13-05df79f63527051ea0071350f86faf76-7/des_generic.ko)
[309602.991225] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 9, gen 0
[309603.001097] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 98852864 on dev /dev/mmcblk0p1
[309603.039636] BTRFS warning (device mmcblk0p1): checksum error at logical 98566144 on dev /dev/mmcblk0p1, sector 192512, root 258, inode 5967, offset 16384, length 4096, links 1 (path: lib/modules/4.4.13-05df79f63527051ea0071350f86faf76-7/snd-timer.ko)
[309603.039649] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 10, gen 0
[309603.049625] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 98566144 on dev /dev/mmcblk0p1
[309603.075685] BTRFS warning (device mmcblk0p1): checksum error at logical 98856960 on dev /dev/mmcblk0p1, sector 193080, root 258, inode 5987, offset 20480, length 1040, links 1 (path: lib/modules/4.4.13-05df79f63527051ea0071350f86faf76-7/des_generic.ko)
[309603.075698] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 11, gen 0
[309603.085654] BTRFS error (device mmcblk0p1): unable to fixup (regular) error at logical 98856960 on dev /dev/mmcblk0p1
[309603.110816] BTRFS warning (device mmcblk0p1): checksum error at logical 98570240 on dev /dev/mmcblk0p1, sector 192520, root 258, inode 5967, offset 20480, length 3408, links 1 (path: lib/modules/4.4.13-05df79f63527051ea0071350f86faf76-7/snd-timer.ko)
[309603.110828] BTRFS error (device mmcblk0p1): bdev /dev/mmcblk0p1 errs: wr 0, rd 0, flush 0, corrupt 12, gen 0
[309603.158417] BTRFS warning (device mmcblk0p1): checksum error at logical 98861056 on dev /dev/mmcblk0p1, sector 193088, root 258, inode 5988, offset 0, length 4096, links 1 (path: lib/modules/4.4.13-05df79f63527051ea0071350f86faf76-7/nf_conntrack_h323.ko)
root@turris:~# ERROR: there are uncorrectable errors

After reboot btrfs scrub status reports no errors although btrfs device stats remain.

  1. How can I fix this? (Should I try to reinstall the packages that contain the impacted files?) Should I reflash factory image?
  2. How can I prevent this from happening again?

in the past I used to have an lxc container but I moved it in external hd.