- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- total disk space used /free .. gigs..
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
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
02-12-2002 11:25 AM
02-12-2002 11:25 AM
total disk space used /free .. gigs..
Is there a command that will give me the total disk space used and free in gigs?
Thanks,
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2002 11:35 AM
02-12-2002 11:35 AM
Re: total disk space used /free .. gigs..
Here's a little awk script that will total up the columns of bdf output for you:
bdf -l | awk '{ if ( $1 > 0 )
{ total+=$1;totused+=$2;totfree+=$3 }
else
{ total+=$2;totused+=$3;totfree+=$4 }
}
END {OFMT="%.2f";print "Total Space Used =",totused/1048576,"GB. Total Space Allocated =",total/1048576,"GB. Total Space Free=",totfree/1048576,"GB."}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2002 11:39 AM
02-12-2002 11:39 AM
Re: total disk space used /free .. gigs..
I will do bdf and do the calculations to get the Gigs
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2002 12:05 PM
02-12-2002 12:05 PM
Re: total disk space used /free .. gigs..
Not sure about a HP-UX command which directly reports disk space in Gbytes (most of the time listing in Kbytes or Mbytes). However, you can do simple calculations on the outputs of following commands:
1) bdf ( lists file system usage in Kbytes )
2) du -k ( directory usage in Kbytes )
3) pvdisplay ( PV usage; multiply PE size with total PE ; in Mbytes)
4) vgdisplay ( VG usage; multiply PE size with total PE; in Mbytes)
5) lvdisplay ( lv size in Mbytes)
6) SAM ( displays all disk information)
7) STM ( online diag )
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2002 12:08 PM
02-12-2002 12:08 PM
Re: total disk space used /free .. gigs..
you can look at the script posted by Andreas Voss in the link below,
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xfb046d96588ad4118fef0090279cd0f9,00.html
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2002 01:26 PM
02-12-2002 01:26 PM
Re: total disk space used /free .. gigs..
bdf|grep -v Filesystem|tr -s " " " "|cut -d" " -f 1-4|sort|
awk 'BEGIN {
prev="";
totals[0]=0;
totals[1]=0;
totals[2]=0;
gtotals[0]=0;
gtotals[1]=0;
gtotals[2]=0;
printf("%4s %14s %14s %14s\n","VG","Size","In use","Available");
}
{split($1,curr,"/");
if (prev!="" && prev!=curr[3])
{printf("%4s %14d %14d %14d\n",prev,totals[0],totals[1],totals[2]
);
gtotals[0]+=totals[0];
gtotals[1]+=totals[1];
gtotals[2]+=totals[2];
totals[0]=0;
totals[1]=0;
totals[2]=0;
}
prev=curr[3];
totals[0]+=$2;
totals[1]+=$3;
totals[2]+=$4;
}
END {
gtotals[0]+=totals[0];
gtotals[1]+=totals[1];
gtotals[2]+=totals[2];
printf("%4s %14d %14d %14d\n",prev,totals[0],totals[1],totals[2]);
printf("%4s %14s %14s %14s\n","----","--------------","-------------
-","--------------");
printf("%4s %14d %14d %14d\n","Totl",gtotals[0],gtotals[1],gtotals[2
]);
}'
to modify for gb's just add the division of 1gb to the output.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2002 01:45 PM
02-12-2002 01:45 PM
Re: total disk space used /free .. gigs..
I sort of got lost trying to read Harry's script, so I now feel like a little bit of comedy.... get a calculator!
Cheers!
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2002 01:54 PM
02-12-2002 01:54 PM
Re: total disk space used /free .. gigs..
You haven't had enough to drink yet :-)) I'll help you out, but I usually don't drink beer, so I'll bring some Wild Turkey : - )
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2002 02:03 PM
02-12-2002 02:03 PM
Re: total disk space used /free .. gigs..
Cheers
hiccup
-Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2002 02:22 PM
02-12-2002 02:22 PM
Re: total disk space used /free .. gigs..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2002 12:30 AM
02-13-2002 12:30 AM
Re: total disk space used /free .. gigs..
Linux knows "df -h" -h for HUMAN.
Calculates to K, M, G according to size of filesystem.
May be you can get the source compiled to HPUX
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2002 08:50 AM
02-13-2002 08:50 AM
Re: total disk space used /free .. gigs..
syntax error The source line is 14.
The error context is
{printf("%4s %14d %14d %14d\n",prev,totals[0],totals[1],totals[2
] >>>
<<<
awk: The statement cannot be correctly parsed.
The source line is 14.
awk: The string ---------- cannot contain a newline character.
The source line is 32.
awk: There is a missing ) character.
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2002 08:55 AM
02-13-2002 08:55 AM
Re: total disk space used /free .. gigs..
attached is the corrected script that harry gave. The problem(s) is when you just cut and paste from the window, there are some lines that wrapped to a new line that shouldn't have. I have fixed it on my machine for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2002 08:56 AM
02-13-2002 08:56 AM
Re: total disk space used /free .. gigs..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2002 09:04 AM
02-13-2002 09:04 AM
Re: total disk space used /free .. gigs..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2002 09:09 AM
02-13-2002 09:09 AM
Re: total disk space used /free .. gigs..
This one should be.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2002 09:16 AM
02-13-2002 09:16 AM
Re: total disk space used /free .. gigs..
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2002 09:18 AM
02-13-2002 09:18 AM
Re: total disk space used /free .. gigs..
live free or die
harry