Bug 263388 - zfs: zpool list -v adds -0 suffix and misaligns columns
Summary: zfs: zpool list -v adds -0 suffix and misaligns columns
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-18 09:20 UTC by John F. Carr
Modified: 2022-04-18 10:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John F. Carr 2022-04-18 09:20:17 UTC
When I run zpool list -v some of my pools have a "-0" suffix after the "raidz2" or "mirror" type string and the remaining columns of that row are misaligned.

I think the combination of factors to trigger this is

1. Have a raidz vdev and a cache vdev in the same pool (not seen with single data disk, with or without cache).
2. Be running 13.1 (behavior not present on 12.3).

Is "-0" a zero-based index into the non-cache vdevs?  If so, it should be omitted when there is only one non-cache vdev.

# zpool list -v
NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
data       36.4T  18.6T  17.8T        -         -    25%    51%  1.15x    ONLINE  -
  raidz2-0  36.4T  18.6T  17.8T        -         -    25%  51.2%      -    ONLINE
    ada0       -      -      -        -         -      -      -      -    ONLINE
    ada1       -      -      -        -         -      -      -      -    ONLINE
    ada2       -      -      -        -         -      -      -      -    ONLINE
    ada3       -      -      -        -         -      -      -      -    ONLINE
cache          -      -      -        -         -      -      -      -  -
  ada4p5    150G  51.6G  98.4G        -         -     0%  34.4%      -    ONLINE
zroot       528G  20.7G   507G        -         -     5%     3%  1.00x    ONLINE  -
  ada4p4    528G  20.7G   507G        -         -     5%  3.91%      -    ONLINE

$ zpool list -v
NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
data       1.81T  1.10T   732G        -         -    27%    60%  1.02x    ONLINE  -
  mirror-0  1.81T  1.10T   732G        -         -    27%  60.5%      -    ONLINE
    da0        -      -      -        -         -      -      -      -    ONLINE
    da1        -      -      -        -         -      -      -      -    ONLINE
cache          -      -      -        -         -      -      -      -  -
  nvd0p5   40.0G  37.5G  2.53G        -         -     0%  93.7%      -    ONLINE
fast        888G   437G   451G        -         -     4%    49%  1.00x    ONLINE  -
  da7       888G   437G   451G        -         -     4%  49.2%      -    ONLINE
cache          -      -      -        -         -      -      -      -  -
  nvd0p7   20.0G  17.1G  2.91G        -         -     0%  85.4%      -    ONLINE