btrfs-progs icon indicating copy to clipboard operation
btrfs-progs copied to clipboard

scrub on one device shows incorrect status

Open espux opened this issue 2 years ago • 2 comments

When running scrub on one device in a multi device filesystem scrub status shows incorrect value for "Total to scrub". Instead it shows same value as "Bytes scrubbed". Also the "Time left" and "ETA" are wrong. This issue seems to have been introduced with V6.3.

Output from v6.2.2 (and earlier):

Scrub resumed:    Mon Oct  9 11:28:33 2023
Status:           running
Duration:         0:49:01
Time left:        15:40:00
ETA:              Tue Oct 10 03:36:02 2023
Total to scrub:   13.55TiB
Bytes scrubbed:   687.76GiB  (4.96%)
Rate:             239.46MiB/s
Error summary:    no errors found

Output from v6.3 (and later):

Scrub resumed:    Mon Oct  9 11:28:33 2023
Status:           running
Duration:         0:44:36
Time left:        0:00:00
ETA:              Mon Oct  9 11:51:38 2023
Total to scrub:   625.49GiB
Bytes scrubbed:   625.49GiB  (100.00%)
Rate:             239.35MiB/s
Error summary:    no errors found

espux avatar Oct 09 '23 10:10 espux

Are you using btrfs scrub status -d? As without -d, at least for the latest code base, it's printing the total used bytes.

For per-device reporting, the output looks lacking the leading lines like Scrub device %s (id %llu).

Otherwise it's indeed a problem, and it looks like it's caused by commit c88ac0170b35 ("btrfs-progs: scrub: unify the output numbers for "Total to scrub""), which changed the print_scrub_dev() to use the real scrubbed bytes.

But that change unfortunately is not good for running scrubs. I can add extra checks to change it to output the old values for running scrubs.

adam900710 avatar Oct 12 '23 02:10 adam900710

This sounds like an issue I encountered in btrfs-progs 6.6.3. Running scrub explicitly on a single device in a two-device filesystem shows the whole filesystem size, and then the scrub finishes at 50%.

csnover avatar Aug 13 '24 21:08 csnover