[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[linux-lvm] LVM mirror resync


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

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

LV_mimage_0 (on /dev/mpath/mpath0p2)
LV_mimage_1 (on /dev/mpath/mpath1p2)
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

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
 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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]