Sunday, February 17, 2008

Solaris How to find free chunk on each vx disk

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"
}'
root@ebitb2b2 $
root$ sh a.sh
... Free chunk on rootmirr(c0t1d0s2) 25226.6 Meg
... Free chunk on rtdisk(c0t0d0s2) 5122.05 Meg
... Free chunk on rtdisk(c0t0d0s2) 0.250977 Meg
... Free chunk on rtdisk(c0t0d0s2) 0.255859 Meg
... Free chunk on rtdisk(c0t0d0s2) 2049.67 Meg
... Free chunk on rtdisk(c0t0d0s2) 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 on "$1"("$2")"" " $5/2/1024, "Meg"
}'
root$