1825768 Members
2260 Online
109687 Solutions
New Discussion

Re: Disk Space in HP UX

 
Andy Cole_1
Frequent Advisor

Disk Space in HP UX

Hi need to check out with you all how to check the available of disk space? what command to execute? lvdisplay? but i do not knw how to calculate when i do a lvdisplay.

Really new to this, hope you can help. Thanks
15 REPLIES 15
curt larson_1
Honored Contributor

Re: Disk Space in HP UX

i think what you're wanting to look at is the bdf command. it will give you information on file systems
curt larson_1
Honored Contributor

Re: Disk Space in HP UX

to check the size of logical volumes, you'd use the lvdisplay command. LV size is the size of the logical volume in megabytes

you'd use the vgdisplay command to find out unused disk space in the volume group. the unused space would be Free PE times the PE size
Andy Cole_1
Frequent Advisor

Re: Disk Space in HP UX

thanks. Can give an example on how to check the disk space? on lvdisplay and vgdisplay? by default there are only one volume group rite? vg00

If there are two hard disk, then it can be two volume group? vg00 and vg01? Or a single hard disk can have two volume group? What is diff between volume group and logical volume?

Thanks.
Hein van den Heuvel
Honored Contributor

Re: Disk Space in HP UX

bdf is a good command, if your concern is with mounted filesystems

The lvdisplay you mention is a good command if your concern is a level lower.

Myself, I use a little perl script I call vginfo.pl to make the vgdisplay info a little more dense. I'll include (wich will hose the proper formatting) and attach it here (for a nice layout). Give it a whirl with 'perl vginfo.pl'

hth
Hein.



$cat vginfo.p
print "Type Name Allocated Total Free\n";
print "----- ----------------------------- -------- -------- --------\n";
foreach $_ (`/usr/sbin/vgdisplay -v`) {
if (/ PVG /) {
$pvg = 1; # Don't know what to do with Private Volume Groups
next;
}
if ($pvg) {
next unless (/^$/);
$pvg = 0;
}

if (/^(\s*\w\w) Name\s+(\S+)/) {
$type = $1;
$name = $2;
$name =~ s/\/dev//;
if ($type =~ /LV/) {
$stripes = 0;
foreach $_ (`/usr/sbin/lvdisplay /dev$name`) {
$stripes = $1 if (/^Stripes\s+(\d+)/);
$ssize = $1 if (/^Stripe S.*\s(\d+)/);
}
$name .= " $stripes x $ssize" if ($stripes);
}
}
if (/^PE Size \(Mbytes\)\s+(\w+)/) {
$pe = $1;
$name = sprintf ("%-28s%2d", $name, $pe);
}
$alloc = int($1) if (/Allo.* PE\s+(\w+)/);
$total = int($1) if (/Total PE\s+(\w+)/);
$free = int($1) if (/Free PE\s+(\w+)/);
if (/^$/) {
if ( 0 == $alloc + $total + $blank_line++) {
print "\n";
} else {
printf ("%-6s%-30s%9d%9d%9d\n",
$type, $name, $pe * $alloc, $pe * $total, $pe * $free);
}
$name = $type = " ";
$alloc = $total = $free = $blank_line = 0;
}
}



$ perl vginfo.p
Type Name Allocated Total Free
----- ----------------------------- -------- -------- --------
VG /vg00 16 15648 69088 53440
LV /vg00/lvol1 304 0 0
LV /vg00/lvol2 4096 0 0
LV /vg00/lvol3 416 0 0

:
PV /dsk/c0t6d0s2 0 69088 53440



VG /vg_oltp 32 614272 614272 0
LV /vg_oltp/lv_oltp 614272 0 0

PV /dsk/c24t0d1 0 307136 0
PV /dsk/c24t0d2 0 307136 0


Patrick Wallek
Honored Contributor

Re: Disk Space in HP UX

Andy,

Welcome to HP-UX land. A lot of the questions you have can be answered by going through some of the documentation available on http://docs.hp.com

Here is the Base HP-UX 11iv1 (11.11) site:
http://docs.hp.com/hpux/os/11i/index.html

Here is the "Managing Systems and Workgroups" manual. For this particular question have a look through the "Administering a System: Managing Disks and Files" section.
http://docs.hp.com/hpux/onlinedocs/5187-2216/5187-2216.html

The docs site is absolutely invaluable. It has almost all the HP-UX docs you could ever want. I go to it fairly regularly!

Good luck with HP-UX!
Andy Cole_1
Frequent Advisor

Re: Disk Space in HP UX

any examples of vgdisplay and lvdisplay?

Differences between them? and how to calculate the disk space? by the way, how to check how many disk is available? thanks
Shaikh Imran
Honored Contributor

Re: Disk Space in HP UX

Hi,
For your last Post:
The command for Number of disk:
#ioscan -fnC disk

Note: this will also show you cd/dvd but that
will be written clearly.

pvdisplay = physical volume which is normally refered to a disk in LVM.

lvdisplay = logical volume display ( you can consider this as partitions on the disk).

The disk capacity will be shown by diskinfo command i.e the disk is of what capacity.
The latest disks shows there capacity in ioscan.

And many of your questions have been answered
by our friend Patrick.

Regards,



I'll sleep when i am dead.
Muthukumar_5
Honored Contributor

Re: Disk Space in HP UX

Hai,

We get the filesystems amount of storage with df command as like bdf command.
du command will give the disk usage on the filesystem now.

machinfo command in latest HP-UX releases will give the memory details.

vgdisplay (volume group ) and lvdisplay (logical volumes ) gives the disk usage of vg's and lv's

vgdisplay details as
=====================
vgdisplay
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 3
Open LV 3
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 4328
VGDA 2
PE Size (Mbytes) 16
Total PE 4318
Alloc PE 4318
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

VG Name /dev/vgscu
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 1
Cur PV 1
Act PV 1
Max PE per PV 8683
VGDA 2
PE Size (Mbytes) 4
Total PE 8681
Alloc PE 8675
Free PE 6
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

To get the lvdisplay use the logical volume from bdf or df command.

example>
lvdisplay /dev/vgscu/lvdest1
LV Name /dev/vgscu/lvdest1
VG Name /dev/vgscu
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 4600
Current LE 1150
Allocated PE 1150
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default


To get all lvdisplay informations from bdf use as like as,
bdf | grep "^[/]" | awk '{print "lvdisplay "$1}' | sh

Regards,
Muthukumar.
Easy to suggest when don't know about the problem!
KapilRaj
Honored Contributor

Re: Disk Space in HP UX

Quicklook doco.

PV ====== Physical volume, this can be a disk or a lun from a disk array.
VG ====== Volume Group, a chunk of data made using one or more PV's.
LV ====== Logical Volume , A slice from the chunk (VG) on which you can create a filesystem.

A PV must be exclusively allocated to only one VG at a time.

So for eg. if u have disk1 and disk 2 of 10 GB each,

Create VG "vgtest" by adding both this PV's (disk1 and disk2)
Create lv's as per ur requirement , it can be 1*20 GB,2*10 GB,4*5 GB, or 20*1 GB lvs.

Create filesystems on the lv's that u have created or use it as raw (for informix or swap).

Regds,

Kaps
Nothing is impossible
Jan Sladky
Trusted Contributor

Re: Disk Space in HP UX

hi Andy,
welcome on this GOOD forum.I suggest you read some docs about HP-UX administration from docs.hp.com or better way (if it is possible in your case) is to take System & Network trainig from HP - very very good.

But we will try to help you even on this forum, don't hesitate to post !

free space of mounting file systems/logical volumes you get by bdf command

number if disk you get from
ioscan -funC disk :read column description, obviously there are even non-hdd devices (cdrom etc)

or you can see

vgdisplay -v :all disks are in section -- Physical volumes -- on bottom of every volume group


br Jan
GSM, Intelligent Networks, UNIX
Andy Cole_1
Frequent Advisor

Re: Disk Space in HP UX

vgdisplay details as
=====================
vgdisplay
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 3
Open LV 3
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 4328
VGDA 2
PE Size (Mbytes) 16
Total PE 4318
Alloc PE 4318
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

VG Name /dev/vgscu
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 1
Cur PV 1
Act PV 1
Max PE per PV 8683
VGDA 2
PE Size (Mbytes) 4
Total PE 8681
Alloc PE 8675
Free PE 6
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

Hi for the above example,
does it means that i have two hard disks? /dev/vg00 and /dev/vgscu
For the /dev/vg00, there are no available space left and the disk size is 4316 x 16MB?
And for /dev/vgscu, the space available is 6 x 4MB?
Michael Tully
Honored Contributor

Re: Disk Space in HP UX

The summary of all that is:
You have two LUNs (disk) one in /dev/vg00 and one in /dev/vgscu
That's correct there is no space available in /dev/vg00 in which to add to any volumes or create one. /dev/vgscu has a total of 24 Mb available.
Anyone for a Mutiny ?
Geoff Wild
Honored Contributor

Re: Disk Space in HP UX

Here's a script:

# vgmbinfo
Name Total MB Used MB Available MB
/dev/vg00 69440 40080 29360
/dev/vg01 69448 69440 8
/dev/vg50 1345968 1345968 0
/dev/vg51 17408 2048 15360
/dev/vg52 241584 238080 3504
/dev/vg55 8704 6144 2560
/dev/vg56 69024 34512 34512
/dev/vg57 34512 25880 8632



Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Ngoh Chean Siung
Super Advisor

Re: Disk Space in HP UX

Hi Kapil Raj,

A PV must be exclusively allocated to only one VG at a time.

I think we can have multiple PV for a VG, right? And the maximum is up to 28 PV per a VG, right? Can I say a PV is equal to a physical hard disk?

regards.
Hein van den Heuvel
Honored Contributor

Re: Disk Space in HP UX

Ngoh Chean Siung... Yes to most, except that '28'.
The absolute max PV is 255, but the max for a given Volume is set during vgcreate with the default being 16. Just check with 'man vgcreate'.

Andy,

In reading vgdisplay, one of the critical lines is 'PE Size (Mbytes) 4'. This refers to Physical Extent and is the unit of measurement for the rest of the story. In your case 4MB, for others 32MB.
Did you check my earlier reply and its attached script? YOu may find it a useful way to summarize vgdisplay data (it outputs in MB, not PE-sizes units.)

Hein.