Operating System - HP-UX
1833589 Members
3670 Online
110061 Solutions
New Discussion

LVM / Striping / Mirroring Fun!

 
SOLVED
Go to solution
Matt Wardle
Advisor

LVM / Striping / Mirroring Fun!

Can anyone stop my brain hurting by solving our LVM problem?

We have 2 disk packs, each containing 3 disks.

One set of disks is physical volume group PVG1, containing:
c0t0d0
c0t2d0
c0t4d0

the other disk pack contains PVG2:
c4t0d0
c4t2d0
c4t4d0

One volume group, vg01, with 6 LV's is on PVG1 and mirrored onto
PVG2.

One disk failed in PVG1 (c0t2d0) and was seriously affecting
system performance, so we lvreduced all logical volumes on that
disk, (because we did not have a spare disk to slot in) eg:

lvreduce -m 0 /dev/vg01/lvol6 /dev/dsk/c0t2d0

This made the system a lot faster again. The extents were never
stale on the bad disk, but it was taking a long time to access
data and the gpm graphs showed continual usage at 100% whereas
it's mirror was mainly idle.

We have replaced the bad disk, but need to recover our mirrored
striped logical volumes. It would have been easy if we hadn't had
to remove the disk, just vgcfgrestore, vgchange then vgsync (I
think).

Here is what we have now for vg01/lvol1:
00000 /dev/dsk/c0t0d0 00000 current
00001 /dev/dsk/c4t2d0 00000 current
00002 /dev/dsk/c0t4d0 00000 current
00003 /dev/dsk/c0t0d0 00001 current
00004 /dev/dsk/c4t2d0 00001 current
00005 /dev/dsk/c0t4d0 00001 current

the volume group is made out of logical extents from 2 primary
disks in PVG1 and 1 mirror from PVG2, the mirror of the bad disk.

Bit of a mixed up situation. Any help on how to get our mirrored
stripes back would be appreciated.

Cheers!

Matt Wardle.
7 REPLIES 7
KapilRaj
Honored Contributor

Re: LVM / Striping / Mirroring Fun!

I think your procedure is correct.

pvcreate newdisk
Update /etc/lvmpvg (?) I forgot the filename
vgcfgrestore
vgsync

Do it when there is less load as lot of I/O will be used to re-establish the mirror

Kaps
Nothing is impossible
Rgomes
Valued Contributor

Re: LVM / Striping / Mirroring Fun!

HI,

1) ioscan
2) vgcfgrestore -n vg01 /dev/rdsk/c0t2d0
3) vgchange -a y vg01
4) pvdisplay -v /dev/dsk/c0t2d0
5) lvextend -m 1 /dev/vg01/lvol6 /dev/dsk/c0t2d0
6) lvdisplay â v /dev/vg01/lvol6

regards,
Rich
Rita C Workman
Honored Contributor

Re: LVM / Striping / Mirroring Fun!

Or you could just do:

vgcfgrestore -n /dev/vgname /dev/dsk/c0t2d0
vgchange -a y /dev/vgname
lvsync /dev/vgname/lvolname

Previous person said to resync the vg, which you could do, but since you know which lvol you removed, you could just sync it and save the extra time spent doing lvols that are already in sync. And doing it in off-time is probably the best.

Rgrds,
Rita
Matt Wardle
Advisor

Re: LVM / Striping / Mirroring Fun!

Kaps - thanks we may try it at a quiet time, the only reason we have not tried it yet was because we thought vgsync only resunk stale extents and we don't have any of them.

Rich - Tried that yesterday, but it wouldn't do it, giving errors saying not enough space or not PV strict.

When we removed the mirrors off the bad disk, because it was striped the other mirrors were reduced as well. So now nothing is mirrored!
Matt Wardle
Advisor

Re: LVM / Striping / Mirroring Fun!

At this point I'd like to say:

*&*&%*&%!!! Striping! More trouble than it is worth!

Matt.
Rgomes
Valued Contributor
Solution

Re: LVM / Striping / Mirroring Fun!

Hi Matt,

Do you have any old backup confgrn of vg01 which is not affected by lvreduce command:
-rw------- 1 root sys 330752 Apr 9 18:00 vg01.conf
-rw------- 1 root sys 330752 Jan 14 13:01 vg01.conf.old <-----this one.

from where you can restore vg01 configuration?

FY reference:
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000072951379 ***
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063247975 **
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062952469
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000066374305
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000066374278

regards,
Richard
A.Cooper
Occasional Advisor

Re: LVM / Striping / Mirroring Fun!

Hi Richard. No - did a diff and they are the same.

However, have just received this advice from HP:

Essentially, you would need to pvcreate and vgextend the new disk back
into the volume group.

Then pvmove all the extents from c4t2d0 to c0t2d0.

Then you could lvreduce all the mirrors out and then re-mirror them
again. You might be able to get away with re-mirroring just that disk,
but I think a full re-mirror would be safer.

I'll have a play with that and the advice I've received from here and let you know what works. Am tempted to blow everything away, recreate using standard LVM mirroring then resore from backups! Anyway thanks for all the help so far.

Matt.