1824638 Members
4637 Online
109672 Solutions
New Discussion юеВ

HP-UX raw disk space

 
SOLVED
Go to solution
Media_Frozen
Advisor

HP-UX raw disk space

Hi Guys,

I have to calculate the total amount of space for each HP-UX servers in the environment, the total disk space should be inclusive of raw disk space in the system. The reason i'm doing this is to determine what kind of tape library and tape media is required to cater for backup for all HP-UX system.

I'm using the script attached in order to help me to that. I took the script from another thread.

#!/usr/bin/sh

#strt=$(ioscan -funC disk | awk '/rdsk/{print $2}')

#

strt=$(ioscan -funC disk |awk '{ if ($3 != "") printf ("%s",$0) ; else printf ("%s\n",$0)}' |grep -v DVD-ROM | grep -v Class | awk '/rdsk/{print $10}')

i=0

p1=0

pT=0

echo $strt > /tmp/siliniz
clear
for i in `cat /tmp/siliniz`
do
p1=$(diskinfo -b $i)
pT=$(expr $p1 + $pT)
done
Tot=$(expr $pT / 1048576)
echo "-------------------------"
echo " Total Disk Size: $Tot GB"
$Tot GB > Total Raw disks
/usr/bin/rm /tmp/siliniz

The output from this script is 651 GB but the output from BDF is 561.58 as shown below:

Filesystem
kbytes
used
avail
%used
Mounted
on

/dev/vg00/lvol3
770,048.00
192464
573080
25%
/


/dev/vg00/lvol1
491,952.00
94080
348672
21%
/stand


/dev/vg00/lvol8
4,608,000.00
3052320
1543672
66%
/var


/dev/vg00/lvol7
4,354,048.00
2455288
1883960
57%
/usr


/dev/vgemc01/openv
560,414,720.00
1.68E+08
3.89E+08
30%
/usr/openv


/dev/vg00/lvol6
2,097,152.00
912200
1176096
44%
/tmp


/dev/vg00/lvol5
5,242,880.00
2641240
2581392
51%
/opt


/dev/vg00/lvol4
397,312.00
346760
50552
87%
/home


/dev/vgemc01/system
10,485,760.00
8730040
1700888
84%
/SYSTEM


Total (Kbyte)
588,861,872.00






Total (Mbyte)
575,060.42






Total (Gbyte)
561.58
- total space require for backup

Total number of space inclusive of swap space in the system is 909GB.

My questions are :
a) What's the reason for the difference of space reported by the script and BDF?
b) Which is is more accurate for backup sizing?
c) Any other way to do this better, i mean to get the total amount of space inclusive of raw disk space?





10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: HP-UX raw disk space

Shalom,

a) Slightly different methodology of calculation. bdf calculates in kb, even in this GB era.
b) The larger number to have a margin of error.
c) Calculate the data that needs to be backed up instead of backing up everything.

My take:
I use ignite to back up vg00 and exclude any scratch data or stuff not needed to boot.

I then use my backup tool to back up backup areas. I can't back up raw disk and don't try. I have scripted backups write backups using utilities provided by the software that uses the raw disk area. These write backups that I actually care about on a daily basis and I back this up. I try if possible to back up to a fast NFS mount point to simply things and not have a lot of scratch space on my systems.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Media_Frozen
Advisor

Re: HP-UX raw disk space

@SEP

a) Slightly different methodology of calculation. bdf calculates in kb, even in this GB era.
b) The larger number to have a margin of error.
c) Calculate the data that needs to be backed up instead of backing up everything.

---------------------------------------------

a) Calculation using bdf by default is in kbytes but if i convert that to GB is 561GB but by using the script the GB reported is 651GB, I'm kind of confused here.
b) Meaning the script is likely not that accurate?
c) I have to put in buffer space for future growth, so I'm trying to get the actual space utilized and factor in maybe extra 40% for future growth.

I would rather backup vg00 using make_tape_recovery, but because of company policy everything must be backed up using centralized backup application.

I appreciate it if anyone could point me to the right direction to calculate the amount of space utilized inclusive of RAW disk space.
Suraj K Sankari
Honored Contributor

Re: HP-UX raw disk space

HI,
>>a) Calculation using bdf by default is in kbytes but if i convert that to GB is 561GB but by using the script the GB reported is 651GB, I'm kind of confused here.

bdf never showes the raw file system due to that this difference would be came.


Suraj
Bill Hassell
Honored Contributor
Solution

Re: HP-UX raw disk space

The diskinfo command shows the size of each disk or LUN. If your question was: how much disk space is allocated to file systems, then bdf would be correct. However, you said you wanted raw space. All disk starts out as raw. You then allocate some space to file systems, and then allocate some space to swap (no filesystems), some space to the crash dump area, and if you are running Oracle, Sybase, Informix, or other major database vendor's product, large amounts of disk space may be allocated to the database but no files.

For backup, you always exclude swap and dump areas (nothing to backup there). For databases using raw space, you'll need special software to properly backup and restore these raw disk areas. If you have no raw database usage, then bdf will give you the actual size. You may want to download the bdfmegs script (attached) which has a -s option to sum all the displayed items.

In picking a tape backup system, be very careful not to concentrate on capacity only. Modern tape drives can be much faster than your system can handle, newer ones require more than 100 MBytes/sec to keep them running at full speed and many systems simply cannot keep up. Also note that adding up what you have now is not a good idea...what about two years from now? Will your system disk space be 100% larger or 500% larger? What are the potential growth areas?

When you pick a tape library, what are the backup goals? Do you expect everything to be backed up in a couple of hours? Are you going to run incremental backups of data files? Is the goal to provide completely automated backups? And the data is sensitive, what encryption will you use to protect tapes in the library or left around on a table?


Bill Hassell, sysadmin
Media_Frozen
Advisor

Re: HP-UX raw disk space

@Bill

I understand bdf will only show filesystem only without RAW disk, but some of the database used here is utilizing raw disk space, how do I get the size of RAW disk space utilized by these databases using hp-ux command?
Johnson Punniyalingam
Honored Contributor

Re: HP-UX raw disk space

Hi Forzen,

>>how do I get the size of RAW disk space utilized by these databases using hp-ux command?<<

Can you list down the raw device files .?
used by the Database. Once done

Use can use "lvdisplay " command to accute size of the raw device .

Example:-

/dev/vgraw/rlvol12
lvdisplay /dev/vgraw/lvol12

Just suggestion.

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Ganesan R
Honored Contributor

Re: HP-UX raw disk space

Hi,

You need some manual work here. Collect the TOTAL PE and PE SIZE from all the VG's which will give the total raw space assiged to the system.

If any vg is not activated, you need to consider that also.
Best wishes,

Ganesh.
Viktor Balogh
Honored Contributor

Re: HP-UX raw disk space

OK, you don't have to fully manual collect the PE Sizes, etc... I wrote a small script that does this, it's in the attachment. Not perfect, but usable. ;)

Sample output:

hi02dit1:/root # ./listdisks.sh

** VOLUMEGROUP vg00 **

140014 MB
140014 MB

** VOLUMEGROUP vg01 **

140014 MB
140014 MB

** VOLUMEGROUP vgapdfk **

XP Box: 00072307 LUN: 07:4B Size: 3600 MB
XP Box: 00072314 LUN: 07:4B Size: 3600 MB

** VOLUMEGROUP vgapvkm **

XP Box: 00072307 LUN: 0A:2B Size: 7200 MB
XP Box: 00072314 LUN: 0A:2B Size: 7200 MB

** VOLUMEGROUP vgapspd **

XP Box: 00072307 LUN: 0A:06 Size: 7200 MB
XP Box: 00072314 LUN: 0A:06 Size: 7200 MB

** VOLUMEGROUP vgapstk **

XP Box: 00072314 LUN: 04:4B Size: 3600 MB
XP Box: 00072314 LUN: 04:70 Size: 3600 MB
XP Box: 00072307 LUN: 04:4B Size: 3600 MB
XP Box: 00072307 LUN: 04:70 Size: 3600 MB

** VOLUMEGROUP vgaprad **

XP Box: 00072314 LUN: 03:4B Size: 3600 MB
XP Box: 00072314 LUN: 03:70 Size: 3600 MB
XP Box: 00072307 LUN: 03:4B Size: 3600 MB
XP Box: 00072307 LUN: 03:70 Size: 3600 MB
hi02dit1:/root #
****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: HP-UX raw disk space

ok, here is the version 2, it uses diskinfo for all disks. (the previous one used diskinfo only for local disks in vg00 or vg01, and xpinfo for the luns in the xp boxes.)

I'm not sure if you have read_lvmtab installed, afaik it is not supported by HP (but still useful).

anyway, this is only a starting point, with a little brainstorming you can customize the snippet and make your own working based on your environment.
****
Unix operates with beer.
Bill Hassell
Honored Contributor

Re: HP-UX raw disk space

It sounds like you weren't the system administrator that created all the volumes on the system. In that case, you can safely assume that if an lvol exists, it is (or was) needed for something. This script will find all the disks and LUNs that are in volume groups and show the PV name, PE size (MB), Total PE's and the total MB for each volume group.

vgdisplay|awk '/VG Name/{printf $3" "};\
/PE Size/{printf $4" "}; \
/Total PE/{getline ;printf $3"\n"}' \
| awk '{print $1,$2,$3,$2*$3" "}'

Whether all the lvols use all the space or not, these PVs have been assigned to volumes and therefore are in use and may be in use in the future.


Bill Hassell, sysadmin