<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculating Disk usage in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006424#M632745</link>
    <description>Sorry, I uploaded a wrong script.</description>
    <pubDate>Wed, 25 Jun 2003 03:28:26 GMT</pubDate>
    <dc:creator>twang</dc:creator>
    <dc:date>2003-06-25T03:28:26Z</dc:date>
    <item>
      <title>Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006418#M632739</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Given a PV I have to calculate the sum of free space on all file systems on that PV. I need to do this programatically, so API(s) would be really helpful.&lt;BR /&gt;&lt;BR /&gt;Thanks and regards&lt;BR /&gt;Sonison James</description>
      <pubDate>Wed, 25 Jun 2003 01:53:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006418#M632739</guid>
      <dc:creator>Sonison James</dc:creator>
      <dc:date>2003-06-25T01:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006419#M632740</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;See if this small script helps you.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;if [ $# -ne 1 ]&lt;BR /&gt;then&lt;BR /&gt;echo "Usage: $0 PV"&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;/usr/sbin/pvdisplay -v $1 &amp;gt; /tmp/pv$$ 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;if [ $? != 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "$1 is not a PV"&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;for LV in $(awk '/current/ {print $3}' /tmp/pv$$|sort|uniq)&lt;BR /&gt;do&lt;BR /&gt;bdf $LV  &amp;gt; /tmp/pv$$ 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? = 0 ]&lt;BR /&gt;then&lt;BR /&gt;FREE=$(df -k $LV|awk '/free/ {print $1}')&lt;BR /&gt;echo $LV ${FREE} KB&lt;BR /&gt;else&lt;BR /&gt;echo "$LV failed"&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;rm /tmp/pv$$&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Jun 2003 02:26:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006419#M632740</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-06-25T02:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006420#M632741</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Not entirely sure what you are trying to achieve but the following may help.&lt;BR /&gt;&lt;BR /&gt;First you need to determine which filesystems are on that PV.&lt;BR /&gt;Issue the following command:&lt;BR /&gt;# pvdisplay -v &lt;BR /&gt;&lt;BR /&gt;This will show you which LV's are using space on that PV.  You can then do a bdf and look at the free space for that LV (filesystem).  Remember that LV's (filesystems) can span multiple disks. You can check which PV's an LV is using by:&lt;BR /&gt;# lvdisplay -v &lt;L volume="" name=""&gt;&lt;BR /&gt;eg lvdisplay -v /dev/vg01/lvol3&lt;BR /&gt;&lt;BR /&gt;To calculate how much free space is on the PV look for "Free PE" value in the pvdisplay output.&lt;BR /&gt;You need to multiply the Free PE value by the PE size (this can seen in the vgdisplay output) to get free space on the PV in Mbytes.&lt;BR /&gt;&lt;BR /&gt;I have attached a script which may help you in analysing your disk usage.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con&lt;BR /&gt;&lt;/L&gt;</description>
      <pubDate>Wed, 25 Jun 2003 02:27:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006420#M632741</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-06-25T02:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006421#M632742</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Sri your script seems to solved my problem except for some 'failed' messages that I get for some LVs. Please see the output that I got for one PV:&lt;BR /&gt;&lt;BR /&gt;[james@c test]$ ./diskinfo /dev/dsk/c1t15d0   &lt;BR /&gt;/dev/vg00/lv_cpifs 926844 KB&lt;BR /&gt;/dev/vg00/lv_i2nj 4462177 KB&lt;BR /&gt;/dev/vg00/lvol1 211224 KB&lt;BR /&gt;/dev/vg00/lvol2 failed&lt;BR /&gt;/dev/vg00/lvol3 123224 KB&lt;BR /&gt;/dev/vg00/lvol4 176480 KB&lt;BR /&gt;/dev/vg00/lvol5 278864 KB&lt;BR /&gt;/dev/vg00/lvol6 147752 KB&lt;BR /&gt;/dev/vg00/lvol7 303280 KB&lt;BR /&gt;/dev/vg00/lvol8 1197752 KB&lt;BR /&gt;&lt;BR /&gt;Am I doing something wrong or is there an error?&lt;BR /&gt;&lt;BR /&gt;Thanks and regards&lt;BR /&gt;Sonison James</description>
      <pubDate>Wed, 25 Jun 2003 03:23:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006421#M632742</guid>
      <dc:creator>Sonison James</dc:creator>
      <dc:date>2003-06-25T03:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006422#M632743</link>
      <description>Attached sysinfo is a very good utility which allow you to collect hpux information, of course you can collect only PHYSICAL DISK DATA.</description>
      <pubDate>Wed, 25 Jun 2003 03:25:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006422#M632743</guid>
      <dc:creator>twang</dc:creator>
      <dc:date>2003-06-25T03:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006423#M632744</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Since /dev/vg00/lvol2 is the primary swap to most HP-UX machines, therefore it is not a filesystem and hence it fails during bdf.&lt;BR /&gt;&lt;BR /&gt;So in other words, those "failed" LVs are not filesystems but raw devices.&lt;BR /&gt;&lt;BR /&gt;Hope this can help.&lt;BR /&gt;&lt;BR /&gt;Kenneth</description>
      <pubDate>Wed, 25 Jun 2003 03:27:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006423#M632744</guid>
      <dc:creator>Kenneth_19</dc:creator>
      <dc:date>2003-06-25T03:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006424#M632745</link>
      <description>Sorry, I uploaded a wrong script.</description>
      <pubDate>Wed, 25 Jun 2003 03:28:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006424#M632745</guid>
      <dc:creator>twang</dc:creator>
      <dc:date>2003-06-25T03:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006425#M632746</link>
      <description>-</description>
      <pubDate>Wed, 25 Jun 2003 03:29:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006425#M632746</guid>
      <dc:creator>twang</dc:creator>
      <dc:date>2003-06-25T03:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006426#M632747</link>
      <description>Hi &lt;BR /&gt;lvol2 will fail in vg00 as it is primary swap, nothing to worry about.&lt;BR /&gt;Sri - thats a nice script.&lt;BR /&gt;&lt;BR /&gt;Should have mentioned my script is only designed if bdf output is on one line.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con</description>
      <pubDate>Wed, 25 Jun 2003 03:31:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006426#M632747</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-06-25T03:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006427#M632748</link>
      <description>Hi Sonison,&lt;BR /&gt;&lt;BR /&gt;If any of the logical volumes is not a filesystem, then it cannot calculate the free space and will display the message "failed".  If you don't like the word "failed", replace it with "undetermined" in the script. I wrote it on the fly to give you an idea so I didn't pay much attention to the messages.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 25 Jun 2003 03:39:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006427#M632748</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-06-25T03:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Disk usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006428#M632749</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Kenneth, Sri and Con thanks for the information, this has solved my problem. Twang thanks for the script.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Sonison James</description>
      <pubDate>Wed, 25 Jun 2003 03:55:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-disk-usage/m-p/3006428#M632749</guid>
      <dc:creator>Sonison James</dc:creator>
      <dc:date>2003-06-25T03:55:16Z</dc:date>
    </item>
  </channel>
</rss>

