Operating System - HP-UX
1834709 Members
2677 Online
110069 Solutions
New Discussion

Re: How to remove a mirror copy forcefully???

 
Sandip Ghosh
Honored Contributor

How to remove a mirror copy forcefully???

We had some disk problem yesterday and after that something got messed up in the logical volume/mirroring structure. Now the condition is as follows:

lvdisplay shows like this:

LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 8192
Current LE 1024
Allocated PE 1024
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c8t8d0 1024 1024
/dev/dsk/c8t10d0 1024 1024

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c8t10d0 00000 current /dev/dsk/c8t8d0 00000 current
00001 /dev/dsk/c8t10d0 00001 current /dev/dsk/c8t8d0 00000 current
00002 /dev/dsk/c8t10d0 00002 current /dev/dsk/c8t8d0 00000 current
00003 /dev/dsk/c8t10d0 00003 current /dev/dsk/c8t8d0 00000 current
00004 /dev/dsk/c8t10d0 00004 current /dev/dsk/c8t8d0 00000 current
.
.
.

Now when I am trying to reduce the mirror copy by giving lvreduce -m 0
it is saying that
There are unallocated Physical Extents in mirrored logical volume.

Thanks in advance for trouble shooting.

Sandip
Good Luck!!!
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: How to remove a mirror copy forcefully???

Sandip,

Have you tried the -k option of lvreduce?


-k This option should be used only in the
special instance when you want to reduce a
mirrored logical volume on a physical volume
that is missing or has failed.

Use this option with the -m option.


Pete

Pete
Sandip Ghosh
Honored Contributor

Re: How to remove a mirror copy forcefully???

If you notice you will see that PE's for disk c8t8d0 all are showing 00000 , and that is the problem. But I can't remove that PV from the VG because there is another filesystem on that disk and that is working fine.

Sandip
Good Luck!!!
Dietmar Konermann
Honored Contributor

Re: How to remove a mirror copy forcefully???

Sandip,

in the case of so called "unallocated extends" you must leave away the PV argument from lvreduce command line. The command will fetch automatically the right PV in this case.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
S.K. Chan
Honored Contributor

Re: How to remove a mirror copy forcefully???

It does not look like this lvol is mirrored at all even though the LE->PE mapping shows otherwise. If it's mirrored the "AllocatedPE" should be double of that of "CurrentLE". I'm not sure but you may be dealing with a corrupted LVM structure.
Have you try this ...
# lvdisplay -v -k /dev/vg0X/lvolX
==> take note of the disk key value (either 0 or 1) then ..
# lvreduce -m 0 -k /dev/vg0X/lvolX
If that does not work I would try to backup all the data which resides in any lvol that span c8t8d0. After that lvreduce it again with the key option. Then vgreduce -f that disk and get the disk replaced.
Sandip Ghosh
Honored Contributor

Re: How to remove a mirror copy forcefully???

Hey,

Sorry for the delay in response.

But with -k option also it is giving the same problem.

Sandip
Good Luck!!!
S.K. Chan
Honored Contributor

Re: How to remove a mirror copy forcefully???

Have you try vgcfgrestore the vgXX.conf file (make sure it's an updated file) onto c8t8d0 ? Take a look also the patch (ie LVM cumulative) you got installed, is it the latest ? Why patch .. because if you look at 11.0 patch PHCO_24437 it addresses some issues with lvdisplay. While you're at it can you provide the output of these ..
# vgdisplay -v vgXX
# lvdisplay -v -k /dev/vgXX/lvolX
Dietmar Konermann
Honored Contributor

Re: How to remove a mirror copy forcefully???

Sandip,
just to repeat my suggesttion above, the complete error message you get from lvreduce is:

"There are unallocated Physical Extents in mirrored logical volume.
Do not specify device file name in order to remove mirror copy."

The "do not" is a MUST.

Just my 2 cents...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Michael Steele_2
Honored Contributor

Re: How to remove a mirror copy forcefully???

You may be reading the PV number incorrectly.

lvdisplay -v -d /dev/vg#/lvol#

LE PV1 PE1 Status 1

0000 1 0198 stale
0001 1 0199 stale
0002 1 0200 stale

For the above example the PV1 column and the number "...1..." is the PV number.

lvreduce -m 0 -k /dev/vg#/lvol# 1

If this doesn't work then try forcing the bad disk off of the vg:

vgreduce -f /dev/vg#

You may have to acitivate this w/out quorum:

vgchange -a y -q n /dev/vg#
vgreduce -f /dev/vg#
Support Fatherhood - Stop Family Law