[linux-lvm] LVM mirror resync

brem belguebli brem.belguebli at gmail.com
Wed Sep 23 12:07:37 UTC 2009


Hi,


I'm trying to find an explanation on how is handled drive failure and
how to recover a LVM mirror with on disk mirror log  from this kind of
failure.


Let me explain, I have this mirrored LV composed of:

LV_mimage_0 (on /dev/mpath/mpath0p2)
LV_mimage_1 (on /dev/mpath/mpath1p2)
and
LV_mlog (on /dev/mpath/mpath0p1)

When I simulate a drive failure (echo 1 > /sys/bus/scsi/devices/
"mpath1 Lunpaths"/delete ), the PV /dev/mpath/mpath1p1 is completely
removed from the VG.
The log is also removed from the VG, though it is located on the still
present physical drive.

When disk mpath1 is back again (echo "- - -"
/sys/class/scsi_host/HOST*/scan), it appears as not belonging to any
VG:

pvs giving the following output:
...
  /dev/mpath/mpath0p1 VG   lvm2 a-    36.00M  36.00M
  /dev/mpath/mpath0p2 VG   lvm2 a-     4.95G 256.00M
  /dev/mpath/mpath1p1        lvm2 --    39.19M  39.19M
  /dev/mpath/mpath1p2        lvm2 --     4.96G   4.96G
...

LV is monitored by dmeventd.

My questions are:

1) Am I using the right method to simulate a drive failure by echoing
a scsi delete ? How would behave the scsi layer in case a disk came to
physically disappear ?

2) If the above method is correct, isn't the role of the mirror log to
keep track of region changes  in case of a drive failure to be able to
incrementally resync the mirror when the missing drive is back to
operation?
 Missing drive is not replaced, the UUID is the same, the problem
could have occured at scsi connectivity not on the physical media (SAN
failure for instance).

3) if so, why does disappear the log device from the VG though being
on a physically present device ?

4) when the missing drive is back again,
    4-1)  why does it appear as not belonging to its original VG ?

    4-2) why doesn't it get automatically resync'ed by dmeventd ? .

The recover process seems to be to reconstruct from scratch the mirror
treating the failed and back again drive as a totally new drive.

Regards




More information about the linux-lvm mailing list