Tuesday, December 6, 2011

Solaris: Vxvm calculate free chunk

root $ sh a.sh
... Free chunk: rootmirr 25226.6 Meg
... Free chunk: rtdisk 5122.05 Meg
... Free chunk: rtdisk 0.250977 Meg
... Free chunk: rtdisk 0.255859 Meg
... Free chunk: rtdisk 2049.67 Meg
... Free chunk: rtdisk 550.151 Meg
root $ more a.sh
#! /bin/sh
  vxdg -g rootdg free | nawk '
        {
           #if ($5/2/1024 > 100)
           if ($5/2/1024 > 0)
              print "... Free chunk: "$1" " $5/2/1024, "Meg"