[linux-lvm] Removing a PV from a mirror

malahal at us.ibm.com malahal at us.ibm.com
Tue Jan 12 19:16:09 UTC 2010


Fredrik Tolf [fredrik at dolda2000.com] wrote:
> Oh, sorry; when I go back and read it, I realize that I was a bit
> unclear. :) The LV started working again once I reconnected the PV and
> rebooted again, so there's no damage done.
> 
> I'm still just wondering how to actually remove the PV from the mirror.

Since your PV is flakey (failing), probably the best way is to convert
the LV to linear first and then converting back to mirror with a new PV.

A failing PV should make the system convert to linear LV if you have
right software (works on RHEL based system). Or you can do the following
steps manually. First step may not be necessary, but it should not cause
any harm in your case.

0) Run vgcfgbackup to back up your LVM metadata. This is needed if
   something goes wrong. You have been warned. If you know, this data is
   already there in archives...
1) lvconvert --mirrorlog core <LV-name>
2) lvconvert -m0 <LV-name> <Failing-PV-name>
	Make sure this did remove the PV you wanted. If not, use
	vgcfgrestore to restore and ask for help...
3) Insert your new disk, create PV label on it, and add it to your VG
4) Run "lvconvert -m1 <LV-name> <New-PV-name>
5) If you need "disk" log, run another lvconvert to get disk log.

Hope this helps,
--Malahal.




More information about the linux-lvm mailing list