1830898 Members
3240 Online
110017 Solutions
New Discussion

Re: Total Disk Space

 
Mehmood Ansari_2
Occasional Contributor

Total Disk Space

Hi
How do I check total disk space on HP_UX system. BDF is showing each mounted file system available space, I want to get total space. It is available in NCR UNIX_SV. I am enclosing both out put.
Thanks and Regards
10 REPLIES 10
Devender Khatana
Honored Contributor

Re: Total Disk Space

Hi,

#vgdisplay -v vg00

Will let you know the allocated and free space in vg00. Samething applies for other LVOLs as well. Apart from this the unused disks can also be seen in

#ioscan -fnC disk

Compare output with the one in
#strings /etc/lvmtab

HTH,
Devender
Impossible itself mentions "I m possible"
Tiziano Contorno _
Valued Contributor

Re: Total Disk Space

VERY dirty, you can elaborate :)

bdf | grep -v kbytes | awk '{ sum += $2; } END { print sum; }'
Senthil Kumar .A_1
Honored Contributor

Re: Total Disk Space

Hi Mehmood,

The query has been intiated by many in ITRC forum from time to time. The answer is "depends"..

We need to identify what are all disks in HPUX box is used for..

1) LVM disks is easier to track, say by /etc/lvmtab file.

2) VXVM disks are also quite easier to track ,say by vxdisk and vxprint commands.

But the real issue is , there is no way to track, whether a app or OS is using a set of disk in the raw device format. If you are a system admin for a Unix box, and u are sure, how the Disk is used as far as raw device utility goes,.. then you can calculate the total disk space available from calculating from LVM and VXVM subsystems. As such a script cannot be written to fetch the data, as the "raw device usage" part might render the output of the script inaccurate.

regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Sivakumar TS
Honored Contributor

Re: Total Disk Space


Hi,

You can do #vgdisplay -v for all VGs and get the info.

Regards,

Siva.
Nothing is Impossible !
Alzhy
Honored Contributor

Re: Total Disk Space

Mehmood,

Peace!

Please find attached 2 scripts I've adapted and developed.

Hope it suits your needs. Or you can modify it to further suit your needs.

Enjoy.

Hakuna Matata.
Alzhy
Honored Contributor

Re: Total Disk Space

Opps .. forgot the attachements.

Here they are one is for LVM another for VxVM (I call the tools vginfo and dginfo respectively).


Hakuna Matata.
Alzhy
Honored Contributor

Re: Total Disk Space

Here's the other one:
Hakuna Matata.
Alzhy
Honored Contributor

Re: Total Disk Space

They're pretty curedely written.. so just improve on 'em.
Hakuna Matata.
Jeff Schussele
Honored Contributor

Re: Total Disk Space

Hi Mehmood,

I would do two things:

1) Get the total disk size:
diskinfo /dev/rdsk/cXtYdZ
repeat for all disks in the VG
Add them all up
Divide by 2 IF the VG is mirrored
This will be the absolute max disk space available.

2) Then get the free space:
vgdisplay /dev/vg_name
And multiply PE Size x Free PE
Divide by 2 IF the VG is mirrored.
This will be the unallocated space that *could* be added to the VG

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mehmood Ansari_2
Occasional Contributor

Re: Total Disk Space

Thanks Nelson