Operating System - HP-UX
1846983 Members
3408 Online
110257 Solutions
New Discussion

11.23 - reduce dead PV from VG permanently

 
Harri.H
Occasional Advisor

11.23 - reduce dead PV from VG permanently

Hi guys!

my environment:
HP-UX 11.23 and EMC Symmetrix storage system

I'm using EMC Clone technology to clone copy shared VG that has one mirror copy (production system). The clone target is having just half amount of PVs comparing to the production.

OK, then I'll import the target VG to a test system.
after import I need to execute:
vgchange -c n # remove cluster conf
vgchange -a y -q n # then activate without quorum

OK, then my question is:
vgdisplay shows that Current PV = 50 and Active PV = 25

of course because the mirror is not available.

Now I would like to remove the 'dead' or 'ghost' PVs from the VG.
I know the PV-Keys for the stale PVs.

I've tried:
# vgreduce -f
Not all extents are free. i.e.
Out of 2085 PEs, only 77 are free.
You must free all PEs using
lvreduce/lvremove before the
PV can be removed.

# lvreduce -m 0 -k
Physical extents on remaining physical
volumes are stale or
Remaining physical volumes are not
responding.
lvreduce: The LVM device driver failed
to reduce mirrors on
the logical volume "".

# lvreduce -m 0 -k
same error as above... this syntax works great on HP-UX 11i v3... but not on HP-UX 11.23 :(
9 REPLIES 9
Rita C Workman
Honored Contributor

Re: 11.23 - reduce dead PV from VG permanently

Sounds similar to a BCV...is that what your trying to do?

Rita
Harri.H
Occasional Advisor

Re: 11.23 - reduce dead PV from VG permanently

Yes... and purpose to remove the dead PVs is to easy future LV-resize task on the business copy volume (clone target)
Rita C Workman
Honored Contributor

Re: 11.23 - reduce dead PV from VG permanently

A thought first.

To mirror on EMC you have to set up a disk to disk sync. i.e.
symbcv -g associate dev
symmir -g -full establish DEVnnn bcv dev

Have you done this for the 25 disks?

Rita
Harri.H
Occasional Advisor

Re: 11.23 - reduce dead PV from VG permanently

No I haven't...

Things I've done:
* I mapped 25 disks for the test system.
* Activated the EMC Clone (snapshot) from 25 production mirror devices to the target devices, visible for the test system.
* vgimport on test system
* vgchange -c n on test system
* vgchange -a y -q n on test system

then I've tried to remove those stale PEs from each LV on the VG... that is my goal.
Rita C Workman
Honored Contributor

Re: 11.23 - reduce dead PV from VG permanently

Going to send this - cause my day is ending & I'm heading home....

Since you say Yes to BCV, this is how I do BCV refreshes (i.e. mirror the disk/split off and them mount only the final BCV mirror on new node). I never did it with less disk though. But hey, that's why they call it a test box.

On the node with the 25 active PV's:

1. Create a file with those EMC disk device numbers (the BCV or clone copy) - one to a line.
2. Run this quick loop to create an output file:
for d in `cat
do
syminq | grep -i $d >>
done

3. Check to make sure you only have the disk info you need (c-t-d-) by doing a simple:
ll | wc -l
If more, clean up the bogus lines you got....till your sure you only have those records. One of the columns will have the device number it in to compare.

4. OK. Now trim down the file for what you really need:
cat | cut -d "" -f 1 >> filename.out1

5. Now you have just the list you want. Such fun...I love this part...
vi
On line one do a CTL A (to put you at end of line). Hit your 'esc' key one time. Now with your curser there, hold down & keep holding down the Shift key and keep hitting the letter "j". You should see the next line jump up to the first line. Keep hitting that letter "j" until you have everything in one continual line!....Such fun.... When it's all one line save the file to a
6. OK...let's deal with your vg.
From the PRODUCTION node create a mapfile this way:
vgexport -pv -m /etc/lvmconf/vgname.mapxx /dev/vgname
Now copy that mapfile over to your test node.
Run (you better be on the test node here)
vgexport
mkdir /dev/vg
mknod /dev/vg/group c 64 0x--0000

Here is the key...
vgimport -v -m /path/vgname.mapxx -f /path/filename.out2 /dev/vgname

This vgimport will take the disk c-t-d- info supplied in that file you created and recreate the volume group with ONLY those disks.

Then do your vgchange lines you mention, and see where your at....and let us know.

Nite,
Rita
Harri.H
Occasional Advisor

Re: 11.23 - reduce dead PV from VG permanently

Yep, that is much like I've done...

however, as all the EMC source ldevs, aka LUNs, that are visible to the test system... are having exactly the information as the production...
and the production VG displays 50 PVs... 25 from each EMC Symmetrix.

clone source and target are from the same EMC Symmetrix. now when I'm importing the target, as a new VG to the test server... (yes, I'm having a disk file (vgimport -f ...)) it still displays all LVs from the imported VG as available/stale, as it can't find the mirror from another symmetrix...

lvdisplay -v displays the stale PVs as ???
although it is able to give a PV-key for it...
Dennis Handly
Acclaimed Contributor

Re: 11.23 - reduce dead PV from VG permanently

>Rita: for d in `cat

You can remove the evil cat with:
for d in $(< ); do

> ll | wc -l

If you want to count the lines in the file:
wc -l

>cat | cut -d "" -f 1 >> filename.out1

(Did you want something in the "", a space?)
You can optimize this to remove the evil cat:
cut -d" " -f 1 > filename.out1

>Such fun...I love this part

Once is fun, otherwise you write a script. :-)

>On line one do a CTL A (to put you at end of line)

I think you meant shift A. And if you really want to just go to the end, just use "$".

>keep hitting the letter "j".

You can use a number before "J".
In fact you don't need to go to the end of the line, maybe just use "100J" and ignore any errors?

>When it's all one line

If you just wanted that, you could redo the cut(1) step:
echo $(cut -d" " -f 1 ) > filename.out2
Harri.H
Occasional Advisor

Re: 11.23 - reduce dead PV from VG permanently

We are getting off from the track now...
I didn't request top tips for VI or for loopping :-)

in a summary what I need:
reduce mirror from each LV in a VG.
reduce dead ("???") PV from a VG that was imported from a production system.

purpose:
* I need to be able to extend those LVs and it is impossible if I can't remove the mirror, right?

* cosmetic error :) I hate to see some "available/stale" messages when running vgdisplay
Subhajit Khanbarman
New Member

Re: 11.23 - reduce dead PV from VG permanently

As you know the PV where the stale PEs are there or which PV is in unavailable state. Please try the following with that PV,

Assume c3t2do is your failed PV

# pvdisplay -v /dev/dsk/c3t2d0 | more
--- Physical volumes ---
PV Name /dev/dsk/c3t2d0
VG Name /dev/vg00
PV Status unavailable

# pvchange -a n /dev/dsk/c3t2d0

will make the disk unavailable to LVM and ready to pull.

Then you try to vgreduce the PV.