Operating System - HP-UX
1834811 Members
3013 Online
110070 Solutions
New Discussion

Re: stale extends and lvreduce

 
SOLVED
Go to solution
Coolmar
Esteemed Contributor

stale extends and lvreduce

Hi

How do I lvreduce the ??? disk?

--- Logical volumes ---
LV Name /dev/vg02/lvol14
VG Name /dev/vg02
LV Permission read/write
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 15008
Current LE 938
Allocated PE 1876
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/c6t0d3 938 938

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 ??? 15691 stale /dev/dsk/c6t0d3 00000 current
00001 ??? 15692 stale /dev/dsk/c6t0d3 00001 current
00002 ??? 15693 stale /dev/dsk/c6t0d3 00002 current
00003 ??? 15694 stale /dev/dsk/c6t0d3 00003 current
00004 ??? 15695 stale /dev/dsk/c6t0d3 00004 current
00005 ??? 15696 stale /dev/dsk/c6t0d3 00005 current
00006 ??? 15697 stale /dev/dsk/c6t0d3 00006 current
00007 ??? 15698 stale /dev/dsk/c6t0d3 00007 current
00008 ??? 15699 stale /dev/dsk/c6t0d3 00008 current
00009 ??? 15700 stale /dev/dsk/c6t0d3 00009 current
00010 ??? 15701 stale /dev/dsk/c6t0d3 00010 current
00011 ??? 15702 stale /dev/dsk/c6t0d3 00011 current
00012 ??? 15703 stale /dev/dsk/c6t0d3 00012 current
00013 ??? 15704 stale /dev/dsk/c6t0d3 00013 current
00014 ??? 15705 stale /dev/dsk/c6t0d3 00014 current
00015 ??? 15706 stale /dev/dsk/c6t0d3 00015 current
17 REPLIES 17
James R. Ferguson
Acclaimed Contributor

Re: stale extends and lvreduce

Hi:

Use the '-k' switch of 'lvreduce'. See the 'lvreduce(1M)' manpages.

Regards!

...JRF...
Patrick Wallek
Honored Contributor
Solution

Re: stale extends and lvreduce

Step 1) Run 'lvdisplay -k /dev/vg02/lvol14' and note the 'PVKEY number fo PV1.

Step 2) Run 'lvreduce -k -m 0 /dev/vg02/lvol14'

Step 3) If you need to reduce the ??? disk out of the VG -- 'vgreduce -f /dev/vg02'

Good luck.
Coolmar
Esteemed Contributor

Re: stale extends and lvreduce

I tried that and it didn't like it....

lvreduce -m 0 -k /dev/vg02/lvol14
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 "/dev/vg02/lvol14".

HOwever, the syntax looks like it requires a device path, but I don't have one...only the ??? as there is no longer a disk.
Mridul Shrivastava
Honored Contributor

Re: stale extends and lvreduce

This is not the way it works.. You need to get the Key value of the disk which showing as ??? in lvdisplay so you need to execute lvdisplay with -k .. then note down the key value shown at the place of ???

Then execute the lvreduce with -k .. this will remove the disk from the configuration.
Time has a wonderful way of weeding out the trivial
Coolmar
Esteemed Contributor

Re: stale extends and lvreduce

Still not working:

# lvdisplay -v -k /dev/vg02/lvol14 |more
--- Logical volumes ---
LV Name /dev/vg02/lvol14
VG Name /dev/vg02
LV Permission read/write
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 15008
Current LE 938
Allocated PE 1876
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/c6t0d3 938 938

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 0 15691 stale 3 00000 current
00001 0 15692 stale 3 00001 current
00002 0 15693 stale 3 00002 current
00003 0 15694 stale 3 00003 current
00004 0 15695 stale 3 00004 current
00005 0 15696 stale 3 00005 current
00006 0 15697 stale 3 00006 current
00007 0 15698 stale 3 00007 current
00008 0 15699 stale 3 00008 current
00009 0 15700 stale 3 00009 current
00010 0 15701 stale 3 00010 current
00011 0 15702 stale 3 00011 current
00012 0 15703 stale 3 00012 current
00013 0 15704 stale 3 00013 current
00014 0 15705 stale 3 00014 current


# lvreduce -m 0 -k 0 /dev/vg02/lvol14
lvreduce: "0": No such file or directory
Usage: lvreduce
[-A Autobackup]
[-k]
{-m MirrorCopies |
-l LogicalExtentsNumber |
-L LogicalVolumeSize}
[-f]
LogicalVolumePath [PhysicalVolumePath ...]


# lvreduce -m 0 -k /dev/vg01/lvol14 0
lvreduce: "/dev/vg01/lvol14": No such file or directory
Usage: lvreduce
[-A Autobackup]
[-k]
{-m MirrorCopies |
-l LogicalExtentsNumber |
-L LogicalVolumeSize}
[-f]
LogicalVolumePath [PhysicalVolumePath ...]


Patrick Wallek
Honored Contributor

Re: stale extends and lvreduce

What version of HP-UX are you running?
Coolmar
Esteemed Contributor

Re: stale extends and lvreduce

11.23
Patrick Wallek
Honored Contributor

Re: stale extends and lvreduce

What happens if you just try a:

# vgreduce -f /dev/vg02
Patrick Wallek
Honored Contributor

Re: stale extends and lvreduce

Try your second lvreduce above again.

You typed:
# lvreduce -m 0 -k /dev/vg01/lvol14 0

And got an error. You should have done:

# # lvreduce -m 0 -k /dev/vg02/lvol14 0
(using vg02/lvol14 rather than vg01).

According to this doc in HP knowledge base, this should work:

Submitted Date: Sat Apr 21 01:00:00 EDT 2007
Title: LVM: splitting a stale mirror from a mirrored volume group
Document ID: emr_na-c01024912-1
Last Modified Date: Fri Aug 05 01:00:00 EDT 2005
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c01024912-1
Coolmar
Esteemed Contributor

Re: stale extends and lvreduce

# vgreduce -f /dev/vg02 |more
Not all extents are free. i.e. Out of 44479 PEs, only 0 are free.
You must free all PEs using lvreduce/lvremove before the PV can be removed.
Example: lvreduce -A n -m 0 /dev/vg01/lvol1.
lvremove -A n /dev/vg01/lvol1
skip alternate link /dev/dsk/c7t0d3
Here's the map of used PEs

--- Logical extents ---
LE LV PE Status 1
0000 lvol1 0000 ???
0001 lvol1 0001 ???
0002 lvol1 0002 ???
0003 lvol1 0003 ???
0004 lvol1 0004 ???
0005 lvol1 0005 ???
0006 lvol1 0006 ???
0007 lvol1 0007 ???
0008 lvol1 0008 ???
0009 lvol1 0009 ???
0010 lvol1 0010 ???
0011 lvol1 0011 ???
0012 lvol1 0012 ???
0013 lvol1 0013 ???
0014 lvol1 0014 ???
0015 lvol1 0015 ???
0016 lvol1 0016 ???
0017 lvol1 0017 ???
0018 lvol1 0018 ???
0019 lvol1 0019 ???
0020 lvol1 0020 ???
0021 lvol1 0021 ???
0022 lvol1 0022 ???
0023 lvol1 0023 ???
Coolmar
Esteemed Contributor

Re: stale extends and lvreduce

Yes, there was a typo...sorry about that. Anyway, new error:

# lvreduce -m 0 -k /dev/vg02/lvol14 0
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 "/dev/vg02/lvol14".
Patrick Wallek
Honored Contributor

Re: stale extends and lvreduce

Well, I'm at a loss. That should work. The only other thing may be load the latest LVM patch.

PHKL_36244 - s700_800 11.23 LVM Cumulative Patch
http://www1.itrc.hp.com/service/cki/patchDocDisplay.do?patchId=pdb_na-PHKL_36244-1

Note that this patch requires a reboot. It also has dependencies of PHCO_35524 and PHKL_31500. Those patches may have dependencies as well, I didn't check though.

Sandman!
Honored Contributor

Re: stale extends and lvreduce

Do you know the PV which has the stale extents for this logical volume? According to the man page for lvreduce(1M) the "-k" option to lvreduce(1M) requires providing the path to the PV that has stale extents or has failed.
Sandman!
Honored Contributor

Re: stale extends and lvreduce

'Tis mentioned in the "EXAMPLES" section of the lvreduce(1M) manpage viz.,

EXAMPLES
.
.
.
Remove a logical volume from a one-way mirrored set on the specified
pv_path.

lvreduce -m 0 -k /dev/vg01/lvol1 /dev/dsk/c1t0d0
Coolmar
Esteemed Contributor

Re: stale extends and lvreduce

Thanks Sandman but I didn't have the PV/device name. Please view the lvdisplay in my original post...the pv I am trying to get rid of is represented by ???
Sandman!
Honored Contributor

Re: stale extends and lvreduce

>the pv I am trying to get rid of is represented by ???

# vgcfgrestore -l -n /dev/vg02
or
# strings /etc/lvmtab

above cmds will give you all PVs that make up the vg02 VG. Thereafter it's a process of selection thru elimination of the non-problematic VGs.

~hope it helps
Sandman!
Honored Contributor

Re: stale extends and lvreduce

Botched my last post as I meant

"...selection thru elimination of the non-problematic PVs".