* direction criterium for synchronisation raid1
@ 2007-10-16 9:28 Christina Braun
2007-10-16 11:33 ` Mario 'BitKoenig' Holbe
0 siblings, 1 reply; 3+ messages in thread
From: Christina Braun @ 2007-10-16 9:28 UTC (permalink / raw)
To: linux-raid
Hello,
which is in raid1 the criterion for the direction of synchronisation? In
case of disk-replacing
or removing one mirror-leg (working actual on the other leg ) and add
the same removed leg later, which has the old data now, again to the mirror?
How can I tell the system which mirrored partition is now the
data-source without
making the raid1 new or zero the superblock? Is the destination in
every case the device
in mdadm manage after the add ? Can I see the source or destination by a
info like mdstat or superblock?
I cannot find the answers of this simple questions. It works by
testing, but I feel better about my production-system and a later
replace if I know it. The found examples describes only the replace of
ascending order second drives.
Thank You,
Christina
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: direction criterium for synchronisation raid1
2007-10-16 9:28 direction criterium for synchronisation raid1 Christina Braun
@ 2007-10-16 11:33 ` Mario 'BitKoenig' Holbe
2007-10-16 13:32 ` Christina Braun
0 siblings, 1 reply; 3+ messages in thread
From: Mario 'BitKoenig' Holbe @ 2007-10-16 11:33 UTC (permalink / raw)
To: linux-raid
Christina Braun <braun@mail.informatik.uni-essen.de> wrote:
> which is in raid1 the criterion for the direction of synchronisation? In
The event counter :)
> How can I tell the system which mirrored partition is now the
> data-source without
> making the raid1 new or zero the superblock? Is the destination in
Usually you don't need to do this. md manages a per-mirror event counter
which always gets increased when relevant events occur like assembling
or stopping an array, adding or removing mirrors etc.
Due to this, whenever you remove a mirror off an raid1, the event
counter of the remaining mirrors gets increased. When you shut down your
machine, plug a disk off and turn the machine on again, once the raid
gets assembled, the event counter of the remaining mirrors gets
increased.
Thus, as long as you access those devices through md only (and don't
mount the device of one of the mirrors as plain filesystem, for
example), the remaining mirrors will always be newer than removed ones
and thus md knows the sync-direction (when they are equally "old", they
are in sync per definition).
There are some exceptions to this:
1. When you like to use the older mirror as source of synchronization,
you have to take care and better zero the superblock of the newer one
before (make sure your raid device did not get assembled, probably based
on the wrong mirror).
2. When you plug a foreign mirror into the system which - however -
refers to the same raid-device (especially having the same UUID etc.)
as your own mirrors but has a bigger event counter, you have to take
care a lot :) This should usually not happen accidentially, as long as
you avoid to assign UUIDs to new raids manually.
> every case the device
> in mdadm manage after the add ? Can I see the source or destination by a
> info like mdstat or superblock?
Have a look at mdadm -E. This shows you the superblocks of single
mirrors and within them their respective event counters.
regards
Mario
--
A promise to a woman is just a lie that hasn't happened yet.
-- Mr. Floppy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: direction criterium for synchronisation raid1
2007-10-16 11:33 ` Mario 'BitKoenig' Holbe
@ 2007-10-16 13:32 ` Christina Braun
0 siblings, 0 replies; 3+ messages in thread
From: Christina Braun @ 2007-10-16 13:32 UTC (permalink / raw)
Cc: linux-raid
Thank you very much for your quick and detailed elaboration! That is my
searched answer and more.
I have made a short test for quick looking at the event-counters with my
testpartitions. I failed and removed the local mirror-leg and keep the
remaining active iscsi-leg on the other server (I use raid1 with iscsi
on 2 servers), copied some files to the md, added then the removed
local partition again. I watched the counters in all phases and can
see the differences and after syncing the same counters. The criterion
event-counter removes also my little doubt about using iscsi-raid1.
Also I am very glad for your advice in case of mounting md-devices as
plain-filesystems and remaining older data in relationship of this
counter. I will now pay great attention to this event-counter :-)
Best regards,
Christina
Mario 'BitKoenig' Holbe schrieb:
> Christina Braun <braun@mail.informatik.uni-essen.de> wrote:
>
>> which is in raid1 the criterion for the direction of synchronisation? In
>>
>
> The event counter :)
>
>
>> How can I tell the system which mirrored partition is now the
>> data-source without
>> making the raid1 new or zero the superblock? Is the destination in
>>
>
> Usually you don't need to do this. md manages a per-mirror event counter
> which always gets increased when relevant events occur like assembling
> or stopping an array, adding or removing mirrors etc.
> Due to this, whenever you remove a mirror off an raid1, the event
> counter of the remaining mirrors gets increased. When you shut down your
> machine, plug a disk off and turn the machine on again, once the raid
> gets assembled, the event counter of the remaining mirrors gets
> increased.
>
> Thus, as long as you access those devices through md only (and don't
> mount the device of one of the mirrors as plain filesystem, for
> example), the remaining mirrors will always be newer than removed ones
> and thus md knows the sync-direction (when they are equally "old", they
> are in sync per definition).
>
> There are some exceptions to this:
> 1. When you like to use the older mirror as source of synchronization,
> you have to take care and better zero the superblock of the newer one
> before (make sure your raid device did not get assembled, probably based
> on the wrong mirror).
> 2. When you plug a foreign mirror into the system which - however -
> refers to the same raid-device (especially having the same UUID etc.)
> as your own mirrors but has a bigger event counter, you have to take
> care a lot :) This should usually not happen accidentially, as long as
> you avoid to assign UUIDs to new raids manually.
>
>
>> every case the device
>> in mdadm manage after the add ? Can I see the source or destination by a
>> info like mdstat or superblock?
>>
>
> Have a look at mdadm -E. This shows you the superblocks of single
> mirrors and within them their respective event counters.
>
>
> regards
> Mario
>
--
********************************************** /\_/\
* email: braun@dc.uni-due.de / 0 0 \
* Christina Braun ====v====
* FB. 5, ICB / Informatik \ W /
* University DE | |
* Schuetzenbahn 70 tel.: + 49 201 183-3929 / ___ \ /
* D-45127 Essen fax.: + 49 201 183-2419 / / \ \ |
**********************************************(((-----)))-'
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-10-16 13:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-16 9:28 direction criterium for synchronisation raid1 Christina Braun
2007-10-16 11:33 ` Mario 'BitKoenig' Holbe
2007-10-16 13:32 ` Christina Braun
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).