- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: total disk usage
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:32 AM
04-16-2007 07:32 AM
total disk usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:39 AM
04-16-2007 07:39 AM
Re: total disk usage
bdf | grep -v ^Filesystem | while read line
do
used=`echo $line | awk {'print $2'}`
(( total=$total+$used ))
done
echo $total " kilobytes of used disk space"
hope this is what you are looking for.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:40 AM
04-16-2007 07:40 AM
Re: total disk usage
lets say you wanted to find out how much disk usage is on vg00, you would do vgdisplay vg00 and you would take Alloc PE number * PE Size (Mbytes) that would give you how much disk is being used in MB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:43 AM
04-16-2007 07:43 AM
Re: total disk usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:45 AM
04-16-2007 07:45 AM
Re: total disk usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:48 AM
04-16-2007 07:48 AM
Re: total disk usage
bdf | grep -v File | awk '{x+=$2}END{printf "%d\n",x}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:49 AM
04-16-2007 07:49 AM
Re: total disk usage
Then:
--------------------------------------------
#!/usr/bin/sh
build_A1()
{
echo "/^Filesystem/ { next}"
echo "{"
echo " v1 += (\$2 + 0); v2 += (\$3 + 0); v3 += (\$4 + 0)"
echo "}"
echo "END {"
echo " print v1,v2,v2"
echo "}"
return 0
} # build_A1
A1=$(build_A1)
bdfmegs | awk "${A1}"
--------------------------------------------
This will actually sum all three of the values but you should easily be able to adapt it to your exact needs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:49 AM
04-16-2007 07:49 AM
Re: total disk usage
# bdf|awk '{if (NR>1) {USED+=$3}};END{print USED}'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:53 AM
04-16-2007 07:53 AM
Re: total disk usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:53 AM
04-16-2007 07:53 AM
Re: total disk usage
bdf | grep -v File | awk '{x+=$3}END{printf "%d\n",x}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 07:59 AM
04-16-2007 07:59 AM
Re: total disk usage
OK, you would like Perl (I do too!):
# bdf|perl -nle 'if ($.>1) {@f=split;$used+=$f[2]};END{print $used}'
...Note that Perl numbers things 0-relative unlike 'awk' which counts its split fields as 1-relative. This too, skips the header line of the 'bdf'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 08:07 AM
04-16-2007 08:07 AM
Re: total disk usage
That's why I suggested bdfmegs and not only will it solve the problem you've now discovered; it will also solve the one that you haven't discovered.
Anyway, here's a copy of Bill's bdfmegs script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 08:19 AM
04-16-2007 08:19 AM
Re: total disk usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2007 08:26 AM
04-16-2007 08:26 AM