Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BTRFS device stats tabular view broken #965

Open
linux4life798 opened this issue Mar 6, 2025 · 0 comments
Open

BTRFS device stats tabular view broken #965

linux4life798 opened this issue Mar 6, 2025 · 0 comments

Comments

@linux4life798
Copy link

linux4life798 commented Mar 6, 2025

It seems as though the tabular mode (-T) of the device stats sub-command seems to be broken. The tabular view shows zero errors, but the normal mode shows many read/write errors for one drive. Luckily, the "check" (-c) mode still seems to work correctly.

Checkout this example:

someuser@nas:~$ sudo btrfs device stats /var/hdd
[/dev/mapper/sdc_crypt].write_io_errs    0
[/dev/mapper/sdc_crypt].read_io_errs     0
[/dev/mapper/sdc_crypt].flush_io_errs    0
[/dev/mapper/sdc_crypt].corruption_errs  0
[/dev/mapper/sdc_crypt].generation_errs  0
[/dev/mapper/sdd_crypt].write_io_errs    0
[/dev/mapper/sdd_crypt].read_io_errs     0
[/dev/mapper/sdd_crypt].flush_io_errs    0
[/dev/mapper/sdd_crypt].corruption_errs  0
[/dev/mapper/sdd_crypt].generation_errs  0
[/dev/mapper/sdb_crypt].write_io_errs    0
[/dev/mapper/sdb_crypt].read_io_errs     0
[/dev/mapper/sdb_crypt].flush_io_errs    0
[/dev/mapper/sdb_crypt].corruption_errs  0
[/dev/mapper/sdb_crypt].generation_errs  0
[/dev/mapper/sda_crypt].write_io_errs    17876972
[/dev/mapper/sda_crypt].read_io_errs     8890703
[/dev/mapper/sda_crypt].flush_io_errs    15
[/dev/mapper/sda_crypt].corruption_errs  3
[/dev/mapper/sda_crypt].generation_errs  0

someuser@nas:~$ sudo btrfs device stats -T /var/hdd
Id Path                  Write errors Read errors Flush errors Corruption errors Generation errors
-- --------------------- ------------ ----------- ------------ ----------------- -----------------
 1 /dev/mapper/sdc_crypt            0           0            0                 0                 0
 2 /dev/mapper/sdd_crypt            0           0            0                 0                 0
 3 /dev/mapper/sdb_crypt            0           0            0                 0                 0
 4 /dev/mapper/sda_crypt            0           0            0                 0                 0

someuser@nas:~$ sudo btrfs device stats /var/hdd
[/dev/mapper/sdc_crypt].write_io_errs    0
[/dev/mapper/sdc_crypt].read_io_errs     0
[/dev/mapper/sdc_crypt].flush_io_errs    0
[/dev/mapper/sdc_crypt].corruption_errs  0
[/dev/mapper/sdc_crypt].generation_errs  0
[/dev/mapper/sdd_crypt].write_io_errs    0
[/dev/mapper/sdd_crypt].read_io_errs     0
[/dev/mapper/sdd_crypt].flush_io_errs    0
[/dev/mapper/sdd_crypt].corruption_errs  0
[/dev/mapper/sdd_crypt].generation_errs  0
[/dev/mapper/sdb_crypt].write_io_errs    0
[/dev/mapper/sdb_crypt].read_io_errs     0
[/dev/mapper/sdb_crypt].flush_io_errs    0
[/dev/mapper/sdb_crypt].corruption_errs  0
[/dev/mapper/sdb_crypt].generation_errs  0
[/dev/mapper/sda_crypt].write_io_errs    17876972
[/dev/mapper/sda_crypt].read_io_errs     8890703
[/dev/mapper/sda_crypt].flush_io_errs    15
[/dev/mapper/sda_crypt].corruption_errs  3
[/dev/mapper/sda_crypt].generation_errs  0

Reproduction:

  1. Remove one hard drive from a mirrored BTRFS filesystem
  2. Run a scrub to generate some IO errors for teh removed disk
  3. Run sudo btrfs device stats /mount-point to see correct errors count
  4. Run sudo btrfs device stats -T /mount-point to see incorrect errors count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant