Re: Subject: RFC: Read repair for md RAID1 after mirror read failures

"G.W. Kant - Hunenet B.V." <[email protected]> Fri, 17 Jul 2026 06:42:12 +0000
Newsgroups org.kernel.vger.linux-raid
Message-ID <[email protected]>
On 7/15/26 8:04 PM, Abd-Alrhman Masalkhi wrote:
> On Wed, Jul 15, 2026 at 19:41 +0200, Abd-Alrhman Masalkhi wrote:
>> Hi Dion,
>>
>> On Wed, Jul 15, 2026 at 14:13 +0000, G. W. Kant wrote:
>>> Hi Abd,
>>>
>>> On 7/15/26 7:27 AM, Abd-Alrhman Masalkhi wrote:
>>>>> With today's 18–24 TB HDDs and backup/archive workloads, where data may
>>>>> remain unchanged for years, latent media degradation seems increasingly
>>>>> relevant. A successful read from the alternate mirror may be one of the
>>>>> last opportunities to refresh such a sector before it becomes
>>>>> permanently unreadable.
>>>>>
>>>> And Check/Repair is the right defense for cold archival data on large
>>>> drives.
>>>
>>>
>>> I have been looking into your suggestion that periodic check/repair is
>>> the appropriate defense for cold archival data on large drives.
>>>
>>> Before I start reading the resync code, I would like to make sure I
>>> understand what repair actually does.
>>>
>>> Suppose all mirrors read successfully and contain identical data. In
>>> other words, there are no read errors and no mismatches.
>>>
>>> Does repair simply verify the data and move on, or does it also rewrite
>>> each successfully read block to the corresponding LBA on every mirror?
>>>
>>> The distinction is important for what I have in mind.
>>>
>>> My concern is not recovery from an existing read error—that is already
>>> handled by fix_read_error()—but rather the long-term aging of cold
>>> magnetic recordings.
>>>
>>> If a sector is still readable today but is approaching the point where
>>> the drive's ECC will eventually no longer be able to reconstruct it,
>>> then a successful rewrite would effectively establish a new "write time"
>>> for that sector. If the drive can no longer reliably store the data at
>>> that location, the rewrite would also give the firmware an opportunity
>>> to remap the sector.
>>>
>>> So my question is essentially:
>>>
>>> Does repair perform such a rewrite of successfully read blocks, or does
>>> it only rewrite blocks when a read error or mismatch has already been
>>> detected?
>>>
>> Okay, I see what you're getting at now. No, check/repair won't rewrite
>> sectors that are read successfully and match across all mirrors. It only
>> rewrites data when it encounters a mismatch or needs to recover from a
>> read error.
>>
>> I think a full-array media refresh is a reasonable idea. but to my
>> knowledge, modern drives already perform background media scans that
>> refresh or remap marginal sectors, which covers part of this...
>>
> 
> I'm not entirely sure about the media refresh part on modern drives...,
> I'll have to look into that first.
> 

Maybe, we could ask the smartmontools people about this. They should 
know this. But I have never read about a refresh action in their 
documentation.

Best regards,

Dion