Re: zpool list -p -v output does not follow manpage
Date: Mon, 23 Jan 2023 20:25:59 UTC
On Mon 2023-01-23 01:15 PM MST -0700, <asomers@freebsd.org> wrote:
> On Mon, Jan 23, 2023 at 1:01 PM Miroslav Lachman <000.fbsd@quip.cz>
> wrote:
>>
>> If we have some sample pool and list verbose statistics we see
>> following
>> output which is OK:
>>
>> # zpool list -v
>> NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP
>> DEDUP
>> HEALTH ALTROOT
>> tank0 492G 5.07G 487G - - 9% 1% 1.00x
>> ONLINE -
>> da0p3 492G 5.07G 487G - - 9% 1.02%
>>
>>
>> But when -p is added to make the output numbers parsable (exact
>> values),
>> the numbers are exact for top level only and the output is nor
>> parsable
>> nor easily human readable (broken columns):
>>
>> # zpool list -v -p
>> NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP
>> DEDUP
>> HEALTH ALTROOT
>> tank0 528280977408 5438681088 522842296320 - -
>> 9% 1 1.00x ONLINE -
>> da0p3 492G 5.07G 487G - - 9% 1.02%
>>
>> This behavior is not documented and I think it is unexpected.
>>
>> The same goes when we need to show just some of possible properties,
>> eg.: name and size:
>>
>> # zpool list -v -p -o name,size
>> NAME SIZE
>> tank0 528280977408
>> da0p3 492G 5.06G 487G - - 9% 1.02%
>>
>> Name and Size is shown for top level but other properties are shown
>> for
>> da0p3 which is again unexpected to me.
>>
>> This is on FreeBSD 12.3-p10, I don't have access to any newere
>> version.
>>
>> Can somebody confirm if this is on newer versions too?
>>
>> And - can this be fixed?
>>
>> Kind regards
>> Miroslav Lachman
>
> It's working correctly for me on 13.1-RELEASE and 14.0-CURRENT.
Also fine for me on 13.1-RELEASE but not 12.4-RELEASE:
[root@ss2] # freebsd-version -k ; zpool list -v -p zpX
12.4-RELEASE
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP
DEDUP HEALTH ALTROOT
zpX 1006632960 93696 1006539264 - - 0%
0 1.00x ONLINE -
mirror 960M 91.5K 960M - - 0% 0.00%
/vd/vd00 - - - - - - -
/vd/vd01 - - - - - - -