Operating System - HP-UX
1752708 Members
5697 Online
108789 Solutions
New Discussion юеВ

Re: calculating total and free disk space on a system

 
SOLVED
Go to solution
Viktor Balogh
Honored Contributor
Solution

Re: calculating total and free disk space on a system

here it is corrected:

vgdisplay 2>/dev/null |grep "VG Name"|awk '{print $3}'|while read a
do
vgdisplay $a|grep "PE Size"|awk '{print $4}'|read b
vgdisplay $a|grep "Total PE"|awk '{print $3}'|read c
vgdisplay $a|grep "Free PE"|awk '{print $3}'|read d
echo "$a $((b*c)) $((b*d))"
done



it should work like a charm:

# vgdisplay 2>/dev/null |grep "VG Name"|awk '{print $3}'|while read a
> do
> vgdisplay $a|grep "PE Size"|awk '{print $4}'|read b
> vgdisplay $a|grep "Total PE"|awk '{print $3}'|read c
> vgdisplay $a|grep "Free PE"|awk '{print $3}'|read d
> echo "$a $((b*c)) $((b*d))"
> done
/dev/vg00 139968 63712
/dev/vghomeora 139968 103968
/dev/vgquorum1 14368 13856
/dev/vgignite 115072 30336
#
****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: calculating total and free disk space on a system

there was a pipe in the first line at the end of the awk statement ;)
(and i added the error redirection just to don't get confused because of disabled VGs)
****
Unix operates with beer.
Sharma Sanjeev
Respected Contributor

Re: calculating total and free disk space on a system

@Ranju Did you read the question, Amit is asking how to see total & free space available in VG's & need script, if you have so many VG's in system OMG

@Amit, Please find attached script, which will give total size of vg, Free size in VG

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE
Amit Manna_4
Occasional Advisor

Re: calculating total and free disk space on a system

hi Sanjeev
Can we get the sum of total space and free space in all VGs?


Regards
Sharma Sanjeev
Respected Contributor

Re: calculating total and free disk space on a system

Amit

Yes, With this Script you can have both

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE