Below is the result of testing a corrupted filesystem. What's going on here?
The kernel message log and the btrfs output don't tell me how many errors
there were. Also the data is RAID-0 (the default for a filesystem created with
2 devices) so if this was in a data area it should have lost data, but no data
was lost so apparently not.
Debian kernel 4.0.8-2 and btrfs-tools 4.0-2.
# cp -r /lib /mnt/tmp
# btrfs scrub start -B /mnt/tmp
scrub done for c0992a26-3c7f-47b0-b8de-878dfe197469
scrub started at Fri Aug 14 10:17:53 2015 and finished after 0 seconds
total bytes scrubbed: 372.82MiB with 0 errors
# dd if=/dev/zero of=/dev/loop0 bs=1024k count=20 seek=100
20+0 records in
20+0 records out
20971520 bytes (21 MB) copied, 0.0267078 s, 785 MB/s
# btrfs scrub start -B /mnt/tmp
scrub done for c0992a26-3c7f-47b0-b8de-878dfe197469
scrub started at Fri Aug 14 10:19:15 2015 and finished after 0 seconds
total bytes scrubbed: 415.04MiB with 0 errors
WARNING: errors detected during scrubbing, corrected.
# btrfs scrub start -B /mnt/tmp
scrub done for c0992a26-3c7f-47b0-b8de-878dfe197469
scrub started at Fri Aug 14 10:20:25 2015 and finished after 0 seconds
total bytes scrubbed: 415.04MiB with 0 errors
# btrfs fi df /mnt/tmp
Data, RAID0: total=800.00MiB, used=400.23MiB
System, RAID1: total=8.00MiB, used=16.00KiB
System, single: total=4.00MiB, used=0.00B
Metadata, RAID1: total=400.00MiB, used=7.39MiB
Metadata, single: total=8.00MiB, used=0.00B
GlobalReserve, single: total=16.00MiB, used=0.00B
# btrfs device stats /mnt/tmp
[/dev/loop0].write_io_errs 0
[/dev/loop0].read_io_errs 0
[/dev/loop0].flush_io_errs 0
[/dev/loop0].corruption_errs 0
[/dev/loop0].generation_errs 0
[/dev/loop1].write_io_errs 0
[/dev/loop1].read_io_errs 0
[/dev/loop1].flush_io_errs 0
[/dev/loop1].corruption_errs 0
[/dev/loop1].generation_errs 0
# diff -ru /lib /mnt/tmp/lib
#
--
My Main Blog http://etbe.coker.com.au/
My Documents Blog http://doc.coker.com.au/
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html