Operating System - HP-UX
1753709 Members
4866 Online
108799 Solutions
New Discussion юеВ

Re: LVM - zoned but unused disks

 
Ra Jose
Regular Advisor

LVM - zoned but unused disks

We have a rp7420 that is connected to EMC symmetrix. Over a period of time, many disks from Symmetrix have been zoned to this server. All of these EMC disks have dual controllers. Not all disks are used on the server (LVM used). I am trying to find out which of these zoned disks are not used by the server.
I tried syminq output matching against vgdisplay -v | grep "PV name" but is not right as some VGs do not have alt links added to them. Tried vgscan, somewhat ok but not convinced. IS there any easy way to find it?
Thanks you all for your replies.
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: LVM - zoned but unused disks

Shalom,

When it gets really confusing, I run a long dd command against the disk device and see which disk light lights up.

But that probably won't work here so.

ioscan -fnC disk

That shows active disks. Any other old device files can be safely removed with rmsf.

Its important to clean up systems once in a while.

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
Sundar_7
Honored Contributor

Re: LVM - zoned but unused disks

Unfortunately, there is no "easy" way of achieving this but there are number of different methods you could use.

Here is one you could use.

# for DSK in $(ls /dev/dsk)
do
echo "$DSK: $(echo '0x2008?4D' | adb $DSK)"
done | sort -nbk 7

This will sort out all the disks based on the LVM header.

Things you need to be aware of to interpret the output

* This works best when there is no clustering involved
* The disks with all 0's in the output means the disk was never used as a PV
* This will not identify the disks used by other volume managers (like VXVM)
* If you had some old volume groups that were "released" by just "vgexporting", then the disks that were part of that VG will still have LVM header on it.
If this is applicable to your
environment, then you will need to identify the active/valid volume groups VGID with the VGID displayed by adb.

Learn What to do ,How to do and more importantly When to do ?
A. Clay Stephenson
Acclaimed Contributor

Re: LVM - zoned but unused disks

You may have a more difficult problem than you know. Consider the case of LUN's being used as raw devices. Perhaps as shared raw devices? Just because a disk (or LUN) is not in use by LVM or VxVM does not mean that it is not in use. One wrong move could destroy tons of valueable data.
If it ain't broke, I can fix that.
Ra Jose
Regular Advisor

Re: LVM - zoned but unused disks

Thank you all. As you anticipated, the server is in SG cluster. I used following 3 methods: 1) vgscan 2) vgdisplay -v | grep "PV Name" 3) method recommended by Sunder. These were matched against syminq (EMC's tool) to find disks zoned. All 3 methods differ slightly in results. Method 1 and 3 found to me more accurate. I thank you all for your replies.
Jo