Operating System - HP-UX
1836611 Members
3931 Online
110102 Solutions
New Discussion

Calculate total VG disk space?

 
Mark Landin
Valued Contributor

Calculate total VG disk space?

How can I calculate the total disk space available in an Ignite config script? I know I can query # of disks, and the size of each disk, but is it possible to easily determine the total size of all disks taken together? Or at least those in the root volume group? Thanks..
9 REPLIES 9
Arockia Jegan
Trusted Contributor

Re: Calculate total VG disk space?

Hi,

run
#vgdisplay

The total VG Disk space=(Total PE x PE Size)Mbytes
Arockia Jegan
Trusted Contributor

Re: Calculate total VG disk space?

I'm sorry.... That's not volume

#vgdisplay

..typo..
S.K. Chan
Honored Contributor

Re: Calculate total VG disk space?

To simplify it a little ..
# vgdisplay vg00|egrep -i "total pe|pe size|free pe|alloc pe"

That gives you something like this ..

PE Size (Mbytes) 4
Total PE 2168
Alloc PE 1928
Free PE 240

Complete the calc ..
a) Total disk space (MB) = 2168*4
b) Total used disk space (MB) = 1928*4
c) Total free disk space (MB) = 240*4

Hope it helps a little ..

Mark Landin
Valued Contributor

Re: Calculate total VG disk space?

I had no idea I could run vgdisplay inside an Ignite config script...?
MANOJ SRIVASTAVA
Honored Contributor

Re: Calculate total VG disk space?

Hi

VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 9
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 2500
VGDA 4
PE Size (Mbytes) 4
Total PE 2046
Alloc PE 2010
Free PE 36
Total PVG 2
Total Spare PVs 0
Total Spare PVs in use 0
the no of free PE ( physical extent ) multiplied by the size of it ie 4 MB will give you the total free size in the volume group


Manoj Srivastava
Sandip Ghosh
Honored Contributor

Re: Calculate total VG disk space?

Calculate the impact as follows:

Also in the "init sw_sel" stanza, add the "impacts" lines by executing the archive_impacts command and include the results in the file, replacing the example impacts lines. By default, this assumes we created a tar archive that was gzip'd.
# /opt/ignite/lbin/archive_impact -t -g

Below is the complete "sw_sel" stanza. We deleted some of the extra stanzas in the example for simplicity.

init sw_sel "golden image" {
description = "Archive HP-UX 10.20 CDE"
sw_source = "core archive"
sw_category = "HPUXEnvironments"
archive_type = gzip tar

# For NFS, the path to the archive is relative to the mount
# point specified in the sw_source:
archive_path = "hpfcnjm2.gz"

# ftp/remsh sources can use a full path:
# archive_path = "/pub/IUXarchives/B.10.20_700_CDE.gz"

impacts = "/" 23Kb
impacts = "/.dt" 35Kb
impacts = "/TT_DB" 18Kb
impacts = "/etc" 1375Kb
impacts = "/export" 1Kb
impacts = "/opt" 74079Kb
impacts = "/sbin" 13449Kb
impacts = "/stand" 1Kb
impacts = "/tmp" 1Kb
impacts = "/usr" 225459Kb
impacts = "/var" 5736Kb

} = TRUE

Sandip
Good Luck!!!
Mark Landin
Valued Contributor

Re: Calculate total VG disk space?

Either you all are missing the point, or I am. :)

What I am wanting to do is determine the size of the root volume group inside an Ignite-UX config script, so I can size filesystems according to how big the root volume group is.

I know that I can use vgdisplay at a shell prompt to figure out how big an existing volume group is, but I find it hard to believe I can run 'vgdisplay' as part of an Ignite config script, parse out the lines I need, and do a computation as some of you are suggesting.

If I'm mistaken, and in fact you can do this, please post a snippet of the required statements from an Ignite-UX script so I can see how to do it.
MANOJ SRIVASTAVA
Honored Contributor

Re: Calculate total VG disk space?

Hi Mark

I think in when you runinstall ignite it shows the root disk size in the filesystem submenu and that is the space avaialbe for the installtion you can add on the fielsystems sizes to calcutate the total diskspace.


Manoj Srivastava
Mark Landin
Valued Contributor

Re: Calculate total VG disk space?

1. I'm not interactive, I'm installing in batch. The config script must be able to make all calculations and decisions.

2. Determining the size of the root DISK is trivial. However, what if I have two or more disks in my root volume group? How do I do it then?