Operating System - HP-UX
1836596 Members
1593 Online
110102 Solutions
New Discussion

Re: unallocated disk space

 
SOLVED
Go to solution
Grant Wenstrand_1
Occasional Contributor

unallocated disk space

Not sure if this is the right forum or not, but it looks like the closest fit.

Would someone be so kind as to share with me a command to return unallocated disk space? I can get it using SAM, but I can't seem to find the right command to return this vaule. Any thoughts?

I am running 10.20.

Thank you.

Grant
9 REPLIES 9
harry d brown jr
Honored Contributor

Re: unallocated disk space

vgdisplay -v vgnamehere

Then look for Free PE, where a PE is usually 4MB.
Live Free or Die
Santosh Nair_1
Honored Contributor

Re: unallocated disk space

you can use the vgdisplay -v command to see the free extents on each VG. Typically an extent is 4MB, so take the free extents and multiply by the PE size, i.e. 4MB to determine in MB the amount of free space on each VG.

-Santosh
Life is what's happening while you're busy making other plans
G. Vrijhoeven
Honored Contributor

Re: unallocated disk space

Hi,

if you want unused disk space on a volume group that you should go with the command Harry gave you. If you want free space in a file system you can use the bdf command.
if you want free space of unused disks you can try finding it with sam.
James R. Ferguson
Acclaimed Contributor

Re: unallocated disk space

Hi:

# vgdisplay /dev/vgXX

...will return the PE size in MB along with the amount allocated and unallocated. Remember, 1MB=1024 KB.

...JRF...
Rita C Workman
Honored Contributor

Re: unallocated disk space

You state 'unallocated' disks. Now if these disks are attached to a vg than the vgdisplay will tell you what has not been extended out....BUT....
Since I'm not sure what kind of disk array you have...I'm not 100% sure what command to state.
If you have an EMC disk array you might want to use the 'inq' utility. But bear in mind that will not report any disks that are being used as raw devices.
Or you may want to use the 'arraydsp' command.
If you have some different kind of disk array you may want to check to see what utilities they offer....

Well, hope this helps get you started at least,

Rit
Sridhar Bhaskarla
Honored Contributor
Solution

Re: unallocated disk space

To get the unallocated disk space, you can do the following.

1. Get the volume groups

$/usr/sbin/vgdisplay -v |grep "VG Name" |awk '{print $3}'
(You will get a list here say vg00,vg01,vg02 etc.,)
$/usr/sbin/vgdisplay vgxx |grep "Free PE" |awk '{print $3}' ---> A
(You will get the number of PEs free on this volume group.)
$/usr/sbin/vgdisplay vgxx |grep "PE Size" |awk {print $4}' -----> B
(You will get the PE size here)
The total space available in this volume group is "Number of Free PE x PE Size" = AxB

Repeat the above for all the volume groups listed in step 1.

You will get free space in each volume group.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
A. Clay Stephenson
Acclaimed Contributor

Re: unallocated disk space

Hi:

Vgdisplay -v can certainly be used to indicate unused LVM space; however, if you want to know much more about disk space and possibly unused physical volumes then the best is an old standby written by Peter Van Giel - lvmcollect.

You can use it as is or modify it to your heart's content.

Clay
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: unallocated disk space

Hi (again) Grant:

Rita's point is well taken. I presume(d) that you are looking at a volume group. To look at a physical disk (maybe just one of several in a vg), do:

# pvdisplay /dev/dsk/cXtYdZ

...or to look merely at the capacity, regardless of whether the physical disk is configured with LVM or not, do:

# diskinfo /dev/rdsk/cXtYdZ

...and note the use of the (r)aw device file in the 'diskinfo' syntax.

Regards!

...JRF...
Grant Wenstrand_1
Occasional Contributor

Re: unallocated disk space

Thank you everyone for your replies. Everyone was so generous with their answers.

Sridhar Bhaskarla, your answer was right on for what I was attempting to accomplish.

Sorry for making all you guys DIG to figure out what I meant.

Cheers,

Grant