1833744 Members
2643 Online
110063 Solutions
New Discussion

disks with associate vg

 
SOLVED
Go to solution
Gerald_13
Frequent Advisor

disks with associate vg

Hi,
I would like to know how list disk with associate vg name and unused disks with one command with one display (like lspv in AIX OS if you know this os)
Thanks very much for your help.

regards,
Gerald
13 REPLIES 13
Robert-Jan Goossens
Honored Contributor

Re: disks with associate vg

Hi Gerald,

How about
# vgdisplay -v /dev/vg00

Robert-Jan.
John Poff
Honored Contributor

Re: disks with associate vg

Hi Gerald,

To list all the disks that a system can see, you can do this:

ioscan -fnC disk

To see which disks are used in your volume groups, do:

vgdisplay -v

I'm familiar with the 'lspv' command in AIX, and there isn't an equivalent command in HP-UX. For you HP-UX guys, here is what the output of an 'lspv' looks like:

# lspv
hdisk0 006016216115490d rootvg
hdisk1 0060162185f82c12 catvg
hdisk2 0060162185f83c87 catvg
hdisk3 0060162185f81a6b bkupvg
hdisk4 006016214a52901a catvg
hdisk5 006016214a52928a catvg

It lists the disk device name, a disk ID, and the volume group that each disk belongs to. Kind of cool, but there isn't a similar command in HP-UX.

JP
James R. Ferguson
Acclaimed Contributor

Re: disks with associate vg

Hi Gerald:

HP-UX doesn't have a single command that provides the information like AIX's 'lspv'.

'ioscan -kfnC disk' will return a list of all disk devices. This does not distinguish between used, unused and 'pvlink' devices.

'vgdisplay -v' will return a listing of all disk devices as associated with all volume groups including the logical volumes (if any) associated with each. It probably comes closest to 'lspv'.

Regards!

...JRF...
Gerald_13
Frequent Advisor

Re: disks with associate vg

Thanks very much Robert-jan but with this command, I haven't got free disks. When there are a lot of disk the "ioscan -fnk -C disk" it is not very good for display the unused disks.
Have you got another solution?

thanks
Gerald
Jose Mosquera
Honored Contributor

Re: disks with associate vg

Hi,

Try with "vgdisplay -v "

If you need more info about use "man vgdisplay"

Rgds.
Robert-Jan Goossens
Honored Contributor

Re: disks with associate vg

Hi Gerald,

Well John showed me what a wonderfull command AIX got, hpux does not do "that" in one command ;>)

Kind regards,

Robert-Jan.
Gerald_13
Frequent Advisor

Re: disks with associate vg

thanks very much for you help.
I've got my reponse, it doesn't exist a similar command as AIX.
OK thank's very much and happy new year everybody and sorry for my bad english.

regards
Gerald
Anthony deRito
Respected Contributor

Re: disks with associate vg

You can compare what is in your lvmtab file with the actual disk devices files on your system. I quickly ran this command to list the physical devices listed in the current /etc/lvmtab file. To do this, make sure that your /etc/lvmtab file is current and accurate.

#strings /etc/lvmtab | grep -v "/dev/dsk" | xargs vgdisplay -v | grep "PV Name"

Then compare this output to the actual physical disks on your system... from ioscan or looking in the /dev directory. Its crude but it one way.... sure you get more responses.
James Murtagh
Honored Contributor
Solution

Re: disks with associate vg

Hi Gerald,

The closest I can think of is a Veritas Volume Manager command, but obviously you need VxVM installed and be at least 11i! Otherwise use strings on /etc/lvmtab

# strings /etc/lvmtab
/dev/vg00
/dev/dsk/c0t6d0
/dev/dsk/c1t4d0
# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c0t6d0 simple - - LVM
c1t0d0 simple disk01 rootdg online
c1t2d0 simple disk02 oracledg online
c1t4d0 simple - - LVM

Regards,

James.

Vitek Pepas
Valued Contributor

Re: disks with associate vg

I don't know HP-UX command that would do it, so I wrote a script (see attachment). It may not be perfect (i.e. it shows CD-ROM just like hard disk), but works for me.
Enjoy!
Gerald_13
Frequent Advisor

Re: disks with associate vg

thanks a lot for your script and thanks everybody !!
regards,
Gerald
MANOJ SRIVASTAVA
Honored Contributor

Re: disks with associate vg

Also Gerald , incase the lvmtab is screwed up or doesnt report the correct disks , string /etc/lvmconf/vg01.conf will tell you the correct inforramtion .


Manoj Srivastava
Daniel B. Smith
New Member

Re: disks with associate vg

If you use the "SAM" utility in HP-UX, you can display all the disks, used and unused.