Friday, May 18, 2012

Disks not in a zpool

Ever wish you had a simple one-liner to tell you which of your /dev/rdsk's weren't in a zpool? Well now you do...
    diff <(zpool status | awk '/c.t.d./ {print $1}' | sort) <(ls /dev/rdsk/c?t?d? | cut -f4 -d/ | sort) | awk '/^>/ {print "free disk: " $2}'

1 comment:

  1. Not sure if dirty hack or awesome hack...

    But, of course, irrelevant when ALL the disks are in zpools, as they should be.

    ReplyDelete