[linux-lvm] Mirror resync direction

Paul LeoNerd Evans leonerd-lvm at leonerd.org.uk
Thu Oct 26 20:17:38 UTC 2006


I'm running kernel 2.6.17 using the lvm2 package currently in debian
testing (2.02.06-3). I use it to set up a VG containing two
PVs, /dev/sda2 and /dev/sdb2. I create a mirror LV using corelog:

  lvcreate --mirror 1 --corelog ...

I create a filesystem on it, and populate it with files. I then try
testing how it copes with drive failures, by simulating a replaced disk.

To do this, I zero out one of the sides using 

  dd if=/dev/zero of=/dev/sda2

Having done that, I do the usual restore method

  pvcreate --uuid 'whatever' /dev/sda2
  vgcfgrestore vg
  vgchange -a y

And I note that it starts to resync the mirror. But it goes in the
"wrong" direction - sda2's PV is the master, but that's been zeroed out.
sdb2's is the slave but contains the real data. The block copying goes in
the wrong direction here, copying the master's zeroes over the good data
in the slave.

Is this a bug in the LVM2 tools, or the dm-mirror target, or what? Is it
perhaps a limitation of --corelog; in which case, how can I protect
against that?


-- 
Paul "LeoNerd" Evans

leonerd at leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20061026/6a135684/attachment.sig>


More information about the linux-lvm mailing list