Re: read and write back full disk to trigger relocation

From: David Christensen <dpchrist_at_holgerdanske.com>
Date: Wed, 31 May 2023 22:46:30 UTC
On 5/31/23 14:44, Sysadmin Lists wrote:
> David Christensen May 31, 2023, 12:30:43 AM
>> On 5/30/23 16:49, Sysadmin Lists wrote:
>>> David Christensen May 30, 2023, 4:16:09 PM
>>>> I would say the experiment should be repeated on real HDD's, but how do
>>>> I detect if identical data has being written to the platters?  The HDD
>>>> controller also has a cache and could optimize away such writes.
>>>
>>> Isn't that what dd is claiming authoritatively to be doing? Otherwise, putting
>>> that example in the manpage is dangerous and can lead to unexpected data loss.
>>>
>>> I don't speak C++ very good, but here's the source:
>>> https://github.com/coreutils/coreutils/blob/master/src/dd.c
>>
>> <snip>
>>
>> Looking at FreeBSD code will not provide information about the HDD
>> controller hardware and firmware.
> 
> You're still not getting it: *they* are the ones claiming to be effectively
> writing out those blocks. It's up to them to validate that claim by accounting
> for whatever HDD controller hardware and firmware are doing.
> 
> There's no magic at play; either the source code proves their claims and
> assumptions or it doesn't.
> 
> Perhaps you can submit a bug report asking them to remove that example from the
> manpage, with something like "you can't make that claim without knowing what
> every HDD controller hardware and firmware are doing." Will be interested in their
> response.


If you feel the need to file a bug report, go for it.


David