I'm working on a script that requires the device name of the disks in all of the vdevs for an arbitrary pool. (All of the devices in the vdevs in my pools are disks.)
zpool list -v mypoolname seems to mostly be what I want:
$ zpool list -v mypoolname NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT mypoolname 100G 90G 10.0G 90% 1.00x ONLINE - mirror 100G 90G 10.0G - devicename1 - - - - devicename2 - - - -
But the only obvious way to determine which lines of the output are the disks is to check for four spaces at the start of the line.
Is there a better, script-safe command I could run instead?