Operating System - HP-UX
1834645 Members
2988 Online
110069 Solutions
New Discussion

Re: pvdisplay to display all pv's on a server

 
SOLVED
Go to solution
Ray Allen_1
Frequent Advisor

pvdisplay to display all pv's on a server

Hi All,

I need run pvdisplay on each disk, but as you can imagine, this could take forever and 5 days with serveral servers. Anyone know of a way to run pvdisplay (without -v) to display all the disks on the server at one time, instead of individually.
I am going output to a file, but want to make sure it works before sending it to a file.

I've tried pvdisplay /dev/dsk/c*t*d*

Thanks for your help.

7 REPLIES 7
Sundar_7
Honored Contributor
Solution

Re: pvdisplay to display all pv's on a server

Try this

# vgdisplay -v | grep dsk | awk '{print $3}' |xargs pvdisplay >> /tmp/pvdisplay.all.out
Learn What to do ,How to do and more importantly When to do ?
A. Clay Stephenson
Acclaimed Contributor

Re: pvdisplay to display all pv's on a server

Well, one approach is:

#!/usr/bin/sh



typeset DSK=""
ls /dev/dsk/* | while read DSK
do
pvdisplay ${DSK}
done

Invoke as "pv.sh > outfile 2>errfile"

This approach will capture all the "good" LVM disks and will send errors on all the "bad" disks (ie those that are no LVM disks or CD-ROM's, etc.) to an error file.
If it ain't broke, I can fix that.
Mridul Shrivastava
Honored Contributor

Re: pvdisplay to display all pv's on a server

Try
pvdisplay /dev/dsk/*
Time has a wonderful way of weeding out the trivial
BPatrick
Trusted Contributor

Re: pvdisplay to display all pv's on a server

Hi Ray,

You can try this command

#ioscan -fnC disk | grep "/dev/dsk" | awk '{print $1}' > /tmp/allpv


Regards

Patrick
BPatrick
Trusted Contributor

Re: pvdisplay to display all pv's on a server

sorry to miss pvdisplay

ioscan -fnC disk | grep "/dev/dsk" | awk '{print $1}' | xargs pvdisplay
>/tmp/allpv
Ray Allen_1
Frequent Advisor

Re: pvdisplay to display all pv's on a server

Sundar's command and A. Clay script worked perfect.

Thanks all.
Ray Allen_1
Frequent Advisor

Re: pvdisplay to display all pv's on a server

Thanks everyone for your responses.