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

Re: mdadm usage



Hello,

On Wed, Dec 30, 2020 at 02:38:46PM +0100, Jesper Dybdal wrote:
> I would hope that the most recently modified half of the array would be the
> one to overwrite the least recently modified one, so that a temporary
> absence of one disk which later comes back unmodified, will not destroy
> data.

Consider what happens if you take an mdadm RAID-1 member and put it
in another machine, mount it and then start writing to it. The
events count of the device will increase with each write.

If you then take that device and put it back in the original
machine, and it has a higher event count than the device in the
machine already, on next assemble mdadm will overwrite the device
that has the lower event count.

You can see the event count with:

# mdadm --examine /dev/sda1 # or whatever the member device is

So yes in one way your idea that the most recently modified half is
the one chosen could be said to be correct, if by "most recently
modified" you actually mean "most number of events".

As you were thinking, it is pretty safe to do if you never write to
the device you take out.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting


Reply to: