Add physical device size to SIZE column in 'zpool list -v'

Add physical device size/capacity only for physical devices in
'zpool list -v' instead of displaying "-" in the SIZE column.
This would make it easier to see the individual device capacity and
to determine which spares are large enough to replace which devices.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Dipak Ghosh <dipak.ghosh@hpe.com>
Signed-off-by: Akash B <akash-b@hpe.com>
Closes #12561
Closes #13106
This commit is contained in:
Akash B
2022-03-09 05:50:41 +05:30
committed by GitHub
parent ce7a5dbf4b
commit 1282274f33
4 changed files with 14 additions and 3 deletions
@@ -48,14 +48,18 @@ log_must zpool checkpoint $NESTEDPOOL
log_must truncate -s $EXPSZ $FILEDISK1
log_must zpool online -e $NESTEDPOOL $FILEDISK1
NEWSZ=$(zpool list -v | grep "$FILEDISK1" | awk '{print $2}')
DEXPSZ=$(zpool list -v | grep "$FILEDISK1" | awk '{print $6}')
nested_change_state_after_checkpoint
log_mustnot [ "$INITSZ" = "$NEWSZ" ]
log_must [ "$DEXPSZ" = "-" ]
log_must zpool export $NESTEDPOOL
log_must zpool import -d $FILEDISKDIR --rewind-to-checkpoint $NESTEDPOOL
nested_verify_pre_checkpoint_state
FINSZ=$(zpool list -v | grep "$FILEDISK1" | awk '{print $2}')
log_must [ "$INITSZ" = "$FINSZ" ]
DEXPSZ=$(zpool list -v | grep "$FILEDISK1" | awk '{print $6}')
log_must [ "$EXPSZ" = "$FINSZ" ]
log_must [ "$DEXPSZ" != "-" ]
log_pass "LUN expansion rewinded correctly."