* [linux-lvm] Removing a PV from a mirror
@ 2010-01-11 16:54 Fredrik Tolf
2010-01-11 18:26 ` Misc Things
0 siblings, 1 reply; 6+ messages in thread
From: Fredrik Tolf @ 2010-01-11 16:54 UTC (permalink / raw)
To: linux-lvm
Hi list,
I've got a mirror volume with two S-ATA disks, one of which started
getting bad sectors recently, and I want to replace it. I'm having
trouble removing it from the volume, however.
When googling around on the subject, I've read everywhere that I
shouldn't have to do anymore than remove it, and LVM should discover
that and reconvert the mirror back into a linear volume. To be a bit
more careful, though, I ran "echo 1 >/sys/block/sdh/device/delete" to
have it removed properly in software first. Much to my surprise, shall
we say, that just made the LV die a horrible death; it started returning
EIO for every access to it, and I had to reboot the server to get it
working again. Again, this is the proper procedure according to what
I've been reading on the net; did I do it wrong, somehow, or are my
sources completely off? (And if this doesn't work, then what would
actually happen if the disk were to fail physically?)
As I rebooted the server, I tried disconnecting the disk in advance, but
that made LVM unable to bring the VG back online at all.
How am I supposed to take this disk out of the volume? If I should use
`lvconvert -m 0 $LV', then how do I specify which disk is to be removed?
I'm using a stock Debian stable (Lenny) installation, meaning Linux
2.6.24 and LVM2 2.02.39.
Appreciative for any answers,
Fredrik Tolf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] Removing a PV from a mirror
2010-01-11 16:54 [linux-lvm] Removing a PV from a mirror Fredrik Tolf
@ 2010-01-11 18:26 ` Misc Things
2010-01-12 3:54 ` Fredrik Tolf
0 siblings, 1 reply; 6+ messages in thread
From: Misc Things @ 2010-01-11 18:26 UTC (permalink / raw)
To: LVM general discussion and development
[-- Attachment #1: Type: text/plain, Size: 1971 bytes --]
oh... sorry to hear.
Actually, Fredrick, you may just answered my question that i posted earlier
about moving VG to another disk(s) and changing the stiping to linear. I
think (hope) that the command i needed is : lvconvert -m 0 ....
i hope you did take a backup ?
Andrew
On Mon, Jan 11, 2010 at 11:54 AM, Fredrik Tolf <fredrik@dolda2000.com>wrote:
> Hi list,
>
> I've got a mirror volume with two S-ATA disks, one of which started
> getting bad sectors recently, and I want to replace it. I'm having
> trouble removing it from the volume, however.
>
> When googling around on the subject, I've read everywhere that I
> shouldn't have to do anymore than remove it, and LVM should discover
> that and reconvert the mirror back into a linear volume. To be a bit
> more careful, though, I ran "echo 1 >/sys/block/sdh/device/delete" to
> have it removed properly in software first. Much to my surprise, shall
> we say, that just made the LV die a horrible death; it started returning
> EIO for every access to it, and I had to reboot the server to get it
> working again. Again, this is the proper procedure according to what
> I've been reading on the net; did I do it wrong, somehow, or are my
> sources completely off? (And if this doesn't work, then what would
> actually happen if the disk were to fail physically?)
>
> As I rebooted the server, I tried disconnecting the disk in advance, but
> that made LVM unable to bring the VG back online at all.
>
> How am I supposed to take this disk out of the volume? If I should use
> `lvconvert -m 0 $LV', then how do I specify which disk is to be removed?
>
> I'm using a stock Debian stable (Lenny) installation, meaning Linux
> 2.6.24 and LVM2 2.02.39.
>
> Appreciative for any answers,
>
> Fredrik Tolf
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>
[-- Attachment #2: Type: text/html, Size: 2558 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] Removing a PV from a mirror
2010-01-11 18:26 ` Misc Things
@ 2010-01-12 3:54 ` Fredrik Tolf
2010-01-12 14:29 ` Misc Things
2010-01-12 19:16 ` malahal
0 siblings, 2 replies; 6+ messages in thread
From: Fredrik Tolf @ 2010-01-12 3:54 UTC (permalink / raw)
To: LVM general discussion and development
On Mon, 2010-01-11 at 13:26 -0500, Misc Things wrote:
> oh... sorry to hear.
[...]
> i hope you did take a backup ?
> Andrew
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.
Fredrik Tolf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] Removing a PV from a mirror
2010-01-12 3:54 ` Fredrik Tolf
@ 2010-01-12 14:29 ` Misc Things
2010-01-12 19:16 ` malahal
1 sibling, 0 replies; 6+ messages in thread
From: Misc Things @ 2010-01-12 14:29 UTC (permalink / raw)
To: LVM general discussion and development
[-- Attachment #1: Type: text/plain, Size: 877 bytes --]
Fredrik, I haven't done this personally, but did remove the pv from stripped
VG. All that was required - i followed the tutorial.
Sorry can't be of more help.
Andrew
On Mon, Jan 11, 2010 at 10:54 PM, Fredrik Tolf <fredrik@dolda2000.com>wrote:
> On Mon, 2010-01-11 at 13:26 -0500, Misc Things wrote:
> > oh... sorry to hear.
> [...]
> > i hope you did take a backup ?
> > Andrew
>
> 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.
>
> Fredrik Tolf
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>
[-- Attachment #2: Type: text/html, Size: 1768 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] Removing a PV from a mirror
2010-01-12 3:54 ` Fredrik Tolf
2010-01-12 14:29 ` Misc Things
@ 2010-01-12 19:16 ` malahal
2010-02-12 17:22 ` Fredrik Tolf
1 sibling, 1 reply; 6+ messages in thread
From: malahal @ 2010-01-12 19:16 UTC (permalink / raw)
To: linux-lvm
Fredrik Tolf [fredrik@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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] Removing a PV from a mirror
2010-01-12 19:16 ` malahal
@ 2010-02-12 17:22 ` Fredrik Tolf
0 siblings, 0 replies; 6+ messages in thread
From: Fredrik Tolf @ 2010-02-12 17:22 UTC (permalink / raw)
To: LVM general discussion and development
On Tue, 2010-01-12 at 11:16 -0800, malahal@us.ibm.com wrote:
> Fredrik Tolf [fredrik@dolda2000.com] wrote:
> > I'm still just wondering how to actually remove the PV from the mirror.
>
> 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...
Ah, so that's how you do it! Thanks a lot!
Fredrik Tolf
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-02-12 17:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11 16:54 [linux-lvm] Removing a PV from a mirror Fredrik Tolf
2010-01-11 18:26 ` Misc Things
2010-01-12 3:54 ` Fredrik Tolf
2010-01-12 14:29 ` Misc Things
2010-01-12 19:16 ` malahal
2010-02-12 17:22 ` Fredrik Tolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).