Operating System - HP-UX
1825021 Members
3488 Online
109678 Solutions
New Discussion юеВ

Re: calculate the size of HD that are there in the server

 
SOLVED
Go to solution
Ahmed M. AlShafiy
Regular Advisor

calculate the size of HD that are there in the server

how can i calculate how much is the full size of the Hard disks that are there in the server.
12 REPLIES 12
MarkSyder
Honored Contributor
Solution

Re: calculate the size of HD that are there in the server

Easiest done in SAM -> discs and filesystems -> disc devices.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Ahmed M. AlShafiy
Regular Advisor

Re: calculate the size of HD that are there in the server

thanks alot but is there any way to calculate how much free space i have as total?
sajeer_2
Regular Advisor

Re: calculate the size of HD that are there in the server


Using sam is the easiest way
sam-->disks and file systems-->disk devices

will show you all the disks present in the system.

You can do this also using command ioscan
#ioscan -fnC disk
will show you all the disk devices including cdrom.
Peter Godron
Honored Contributor

Re: calculate the size of HD that are there in the server

Ahmed,
the answer is still SAM, as you do not define what you want to count.
SAM will show you:
1. All physical connected disks
2. All space in Volume Groups
3. All space Logical Volume

For example:
You may have a disk on the machine, which is not mounted, so can not be used on server, but could be used, if assigned to vg and lvol built.
Ralph Grothe
Honored Contributor

Re: calculate the size of HD that are there in the server

Hi Ahmed,

a very crude summation of total allocatable space of attached disk storage can be done with this one-liner.

# ioscan -knfdsdisk|awk '/rdsk/{print$NF}'|xargs -n1 diskinfo|awk '$1~/size:/{s+=$2};END{printf"%10.2f GB\n",s/2^20}'
191.63 GB


But this has a few deficits.
If you use multiple paths for e.g. attached SAN storage you may count the space twice.
Also your host may see SAN space not intended for normal usage by this host (think of clustered systems who only act as failover nodes for applications and their storage).
As you can see, it isn't really that easy.
As admin you must know what of the attached storage is used in what way way.

If you want to find out the not yet allocated disk space you could do a similar count of free physical extents PEs of every volume group.
But again, with cluster shared VGs you might get misleading results.
Also note that you must distinguish between disk space already under control of a volume manager like LVM or VxVM and that still "floating" around or used in different ways.
Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: calculate the size of HD that are there in the server

Besides, I forgot to mention mirrored volumes or other raid volumes (e.g. plexes in VxVM).
With those you need to split your calculations to end at the effective usable disk space.
Madness, thy name is system administration
V. Nyga
Honored Contributor

Re: calculate the size of HD that are there in the server

Hi,

for free disk space you also can use 'bdf'.
But here you also have to check if mounted disks are listed oftener.

You get a list of available space under 'avail'.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Raj D.
Honored Contributor

Re: calculate the size of HD that are there in the server

Ahmed ,

Also you can find the script here , Bill's good bdfmegs script to check filesystem size in MB / GB.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1048509


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Yang Qin_1
Honored Contributor

Re: calculate the size of HD that are there in the server

Hi, Ahmed,

You may use vgdisplay -v to check the free disk space:

vgdisplay -v | grep -E "PE Size|Free PE" |grep -v " Free PE"

The output will be something like:
PE Size (Mbytes) 4
Free PE 46
PE Size (Mbytes) 4
Free PE 1003
PE Size (Mbytes) 4
Free PE 5178

In this case, the total free disk space (configure in VG greoups)on this server is:
4x46 + 4x1003 + 4x5178 = 24908 MB

bdfmgs (or bdf command) count free disk space on each lvol/mount point and vgdisplay -v provide free disk space can be used to extend existing lvols or create new lvols.

Regards,
Yang
Bill Hassell
Honored Contributor

Re: calculate the size of HD that are there in the server

Be careful about defining "free space". According to bdf or vgdisplay or VxVM tools, there can be be large chunks of disk that are not used by a filesystem but are not free. An example is for swap space (typically /dev/vg00/lvol2, possibly others -- see swapinfo -tam) and databases that use raw partitions or logical volumes. You need to talk to the system and application managers to see if they are using raw partitions.


Bill Hassell, sysadmin
Nagashankarp
Frequent Advisor

Re: calculate the size of HD that are there in the server

first find out which disks are configured with strings /etc/lvmtab
and then if you want to display complete the disk that is configured use pvdisplay /dev/dsk/cxtxdx
multiply PE Size * total PE

if the disk is not configured diskinfo is teh best command but remember to use rdsk instead of dsk ( character device )
VK2COT
Honored Contributor

Re: calculate the size of HD that are there in the server

Hello,

I wrote a Perl scipt for disk
and many other HP-UX tests (more
than 200 different tests).

http://www.circlingcycle.com.au/Unix-sources/HP-UX-check-OAT.pl.txt

As long as you have a decent (anything
about 5.005) version of Perl, it works
very nicely.

So far, it helped me check
HP-UX servers (from small servers to
large SuperDomes) many times.

VK2COT
VK2COT - Dusan Baljevic