[linux-lvm] Fun and games with mirroring
lvm at beer.org.uk
Tue May 22 16:40:36 UTC 2012
>> You can do it to a box that hasn't been set up with mdadm...
> Sure but you will need LVM set up.
I always have.
> In that case, why not use LVM's snapshot capabilities?
Because that doesn't do what I want.
I'm not looking to have a LVM snapshot. I'm looking to have a duplicate
disk. This allows me to experiment on one, whilst keeping the other safe.
Alternatively, it allows me to migrate from one disk to another without
too much risk - before anyone points me at pvmove, I lost a filesystem
when that fell over on a live machine once :-(
> You might find this works better for this particular use of mirroring
> but you can also try the --splitmirrors option to the lvconvert
> command (but it will be less efficient since it will take a
> block-by-block copy of the origin during the lvconvert -m1 rather than
> just recording changes as a snapshot would). Mirror splitting was
> added in 2.02.88 (about nine months old).
--splitmirrors would seem to do what I'm after *except* that it will leave
the mirror unbootable without further attention (the machine won't boot
with the wrong name on the LVs)
> I've found that dracut doesn't always handle LVM errors particularly
> gracefully (in particular if there is a problem the dracut main loop
> appears to reset state after leaving the interactive shell so even if
> you do fix the problem such that the system could continue to boot it
> will just fail in the same way again) and by the sound of it this
> could be improved for your case too.
This is true - but sorta misses the point; a LV mirror is not a LV mirror
if it won't activate. Adding a mirror means that a faliure of *either*
side renders the whole unusable.
> Ideally you'd want the initramfs scripts to carry out the same actions
> as the defined mirror repair policy during startup (or to invoke
> lvconvert --repair to do the same).
Well, we can call it Somebody Else's Problem, or perhaps LVM should be
able to use a broken mirror - that's how every other mirror system works,
and is generally the very reason for having a mirror at all. I consider
this to be a bug within LVM.
More information about the linux-lvm