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
zpool list -v console output formatting #7308
Comments
even that one does not format correctly (the lines with the pool names) |
Workaround (not 100% perfect but close) : zpool list -v |column -tNAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT |
Hey. This very same thing was bothering me quite a bit recently. I took a dive into (Skip to the end if you only care about the patch itself; explanationy stuff incoming.) Commands like Prior to iterating over the pool vdevs and triggering the callbacks that print the console output, the The root of the problem is as follows. Unlike Here's the patch I hacked together. (Featuring an additional Basically I just duplicated the My patch does compile, and it "works for me". I don't know if it'll work correctly in every single situation with every possible pool configuration; or whether I'm doing things slightly incorrectly/non-optimally; and of course the whole "duplicating code and then renaming it" thing is rather dubious. (Unfortunately the Without the patch:
With the patch:
I hope this helps. |
@jgottula are you planning on opening a pull request with your patch? I think it would be a useful fix. |
If anyone had trouble getting the patch I posted a few days ago to apply, I discovered that it was probably a bit munged. So I've uploaded a revised version that I actually bothered to test with the
Possibly. From looking through the code, it does feel like an area that sort of needs a general cleanup (renaming functions, reducing duplication of code), and if I simply dropped the patch in as-is, I'd frankly just be making that situation worse. So I'm more inclined to leave this as a starting point for anyone else who's more familiar with the relevant code and wants to do a PR that "does it right", so to speak. |
still exists with 0.8.0-rc2 |
PR opened, see #8147 and please feel free to review. |
The verbose output of 'zpool list' was not correctly aligned due to differences in the vdev name lengths. Minimally update the code the correct the alignment using the same strategy employed by 'zpool status'. Missing dashes were added for the empty defaults columns, and the vdev state is now printed for all vdevs. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#7308 Closes openzfs#8147
Distribution Name | CentOS7
Distribution Version | 7.4.1708 (Core)
Linux Kernel | 3.10.0-693.17.1.el7.x86_64
Architecture | .x86_64
ZFS Version | 0.7.6-1
SPL Version | 0.7.6-1
Describe the problem you're observing
while commands like "zpool iostat -l -q -v 1" , "zpool status" or "zfs list"
produce nicely formatted output and all is properly column/tab aligned, "zpool list -v" output looks horribly broken
# zpool list -v
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
timemachinepool 10,9T 2,58T 8,29T - 4% 23% 1.00x ONLINE -
raidz2 10,9T 2,58T 8,29T - 4% 23%
ata-WDC_WD2003FYYS-02W0B0_WD-WMAY00390617 - - - - - -
ata-WDC_WD2003FYYS-02W0B0_WD-WMAUR0553783 - - - - - -
ata-WDC_WD2003FYYS-02W0B0_WD-WMAUR0599953 - - - - - -
ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M7VPE2A6 - - - - - -
ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M7VPENJ5 - - - - - -
ata-ST32000542AS_9XW025NK - - - - - -
The text was updated successfully, but these errors were encountered: