1833875 Members
1671 Online
110063 Solutions
New Discussion

Re: hard disk space

 
SOLVED
Go to solution
Fauziah Mahdan
Super Advisor

hard disk space

Hi all,
What is the command to get the hd space for the server. I am using bdf and sum up total kb only 22G. using ioscan I can find out 4 hd 18G and another 10hd with unknown size.
I check my oracle db was entitle to diff vg like, vg02/rlvol1 vg03/rlvol14 and etc.
But from bdf this vg02 and vg03 were not listed. Hp configure this as raw device and also mirror hd. How to get all disk size to document it.

Thanks
5 REPLIES 5
Matthew_50
Valued Contributor

Re: hard disk space

#!/bin/ksh

for i in vg02 vg03
do
echo $i
for x in `vgdisplay -v $i|grep -v Alternate|grep PV\ Name|awk -F/ '{print $4}'`
do
diskinfo -v /dev/rdsk/$x
done
echo ""
done

sample output like following.

vg02
SCSI describe of /dev/rdsk/c4t2d0:
vendor: HP
product id: C5447A
type: direct access
size: 101376000 Kbytes
bytes per sector: 512
rev level: HP62
blocks per disk: 202752000
ISO version: 0
ECMA version: 0
ANSI version: 2
removable media: no
response format: 2

vg03
SCSI describe of /dev/rdsk/c4t1d0:
vendor: HP
product id: C5447A
type: direct access
size: 162527744 Kbytes
bytes per sector: 512
rev level: HP62
blocks per disk: 325055488
ISO version: 0
ECMA version: 0
ANSI version: 2
removable media: no
response format: 2
Shyjith P K
Frequent Advisor

Re: hard disk space

Use the following command.

vgdisplay |egrep "VG Name|PE Size|Total PE"

Then, multiply the "PE Size" and "Total PE" to get the VG size (in Mbytes).

--Shyjith
DCE
Honored Contributor

Re: hard disk space

if you want to get detailed info, for example, which disk are in which vg

use

vgdisplay -v /dev/vg02 | more

Dave
David Child_1
Honored Contributor
Solution

Re: hard disk space

bdf only shows file system information. Since you are also using raw devices this would not work on these.

As previously mentioned you can use vgdisplay on each volume group and pull the total amount in each volume group (Total PE * PE Size = Mb). You can also determine how much of that space has been allocated (Alloc PE * PE Size =Mb).

To see how many disks have been assigned to the server (note: some may not have been assigned to volume groups and therefore vgdisplay wouldn't show them); Run ioscan and get the /dev/rdsk/c*t*d* for each disk. Then run 'diskinfo /dev/rdsk/c*t*d*' and it will show you the size of each disk.

David
Ralph Grothe
Honored Contributor

Re: hard disk space

This can get quite involved
as it depends on what you are regarding as used hard disk space.

Since you are talking about a DB I would assume it's mainly its allocated disk space.
Then again DB disk space usually isn't internal one but comes from external SAN storage.

Thus I assume you would want to discard the root disks in vg00.

As we don't know whether the DB is using filesystem or raw devices the easiest summation would add total PEs times the the PE sizes of each VG not being vg00.

Let's collect VGs

# vgs=$(vgdisplay 2>/dev/null|awk '/VG Name/&&$NF!~/vg00/{print$NF}')

# typeset -i tot=0 pe sz
# vgdisplay $vgs|awk '/Total PE|PE Size/{print$NF}'|while read sz;read pe;do tot=$((tot+(sz*pe)));done

This yields in my case some 420 GB used up disk space in non Root VGs.


# echo "scale=2;$tot/2^10"|bc
423.88


Ok, this was based on rather crude assumptions.
Maybe your users/clients are paying for disk space actually allocated rather than captured in a VG?

Then yop would have to sum up the sizes of all LVs of those VGs.

e.g.

# lvdisplay $(vgdisplay -v $vgs|awk '/LV Name/{print$NF}')|awk '/LV Size/{s+=$NF};END{printf"%10.2f\n",s/2^10}'
339.69

As you can see this, we still have some free PEs in our VGs for lvextends.

However, consider that our host just might be a cluster node whose packages use storage from cluster shared VGs.

Then you would have to do a similar summation on every clsuter node as well.
Madness, thy name is system administration