Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

du for total 3

Status
Not open for further replies.

gatetec

MIS
Mar 22, 2007
420
US
// AIX 5.2.8

I need to figure out the ** total size ** of an AIX node in GB for a capacity planning.
I like to know the total size by mounted filesystems vs the others.

thx much
 
so why dont do a:

df -g

that will give the various sizes (total, free, etc) in GB for all all file systems.

OR

you could do:

du -sg /some/mount_point

that would give the total size in GB for the specified mount point.

Add a little color to your PUTTY terminal: faq52-6627
 
du -sg under root@prod:/> gives the **total size** of the node regardless mounted or unmounted, and it includes /dev and other filesystems, dir, etc?

thx much
 
try doing first lsvg to get the volume groups then for each volume group do lsvg volume_group_name and see the used PPs vs total PPs

for example,

lsvg rootvg

Regards,
Khalid
 
This will get you the total based on the overall size of all volume groups, which sounds more like what you want.

Code:
lsvg | while read vg
do
lsvg $vg
done |\
perl -ne '
  $megs += $1 if /TOTAL PPs:.*\((\d+) mega/;

  END{ print $megs . " total megabytes\n";}
'

- Rod


IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
It gives a lot more than the actual total size.
How can I get the sum of acutal total size?
 
Good morning,

what's wrong with

cd /
du -g

?

Shouldn't that produce the required output ?

Regards
Thomas
 
gatetec,

If by "actual total size" you mean the space used by files and directories on the filesystem, you're not going to be able to check unmounted systems. Commands like 'du' need to be able to examine the filesystem and it's mounting that makes that possible. One utility that does know how to navigate an unmounted filesystem is fsck, but I'm not sure if it'll give you the information you need.

If you mean the space allocated to logical volumes, just change "TOTAL PPs" in the script I posted to "USED PPs".

- Rod


IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top