Page 1 of 1

Reinitialization levels and custom write patterns

Posted: 2021.01.31. 13:03
by otter
Brilliant software! I'm learning about the benefits of data destructive disk testing this week and learned to test with Linux badblocks utility that runs four write passes as follows

0xAA = 10101010
0x55 = 01010101
0xFF = 11111111
0X00 = 00000000

There are occasions when I'd prefer to do testing from Windows instead and especially times where I'll want to run lesser write tests on new disks because of time constraints. I read your forum post here

https://www.hdsentinel.com/forum/viewto ... ell#p16420

where you indicate the Reinitialize Disk Surface test does 4 writes and 1 reads on all sectors. By chance is it doing the same write patterns sequence as the linux badblocks utility? If not, what is the write sequence? I saw under custom you have the option for reinitialization level 3 2 1 and thought maybe that was a means to toggle which write sequences were being written or something like that?

In a time crunch, and for lack of knowing, I've just been run some write + read tests using the random data option. I saw from your post here

https://www.hdsentinel.com/forum/viewto ... ata#p18780

that you encouraged using the random data write pattern instead of all zeros. I'll always try to remember to use the random write pattern instead of all zeros unless there is an obvious use case you advise otherwise (maybe SMR disks or something?)

Thanks in advance for your awesome expertise!

Re: Reinitialization levels and custom write patterns

Posted: 2021.02.01. 15:26
by hdsentinel
Thanks for your message and kind words !

> where you indicate the Reinitialize Disk Surface test does 4 writes and 1 reads on all sectors.
> By chance is it doing the same write patterns sequence as the linux badblocks utility? If not, what is the write sequence?

The write pattern sequence is almost similar to what you wrote:

1: 0xAA = 10101010
2: 0x55 = 01010101
3: 0xAA = 10101010
4: 0X00 = 00000000

Generally the idea is exactly to force all bits to alternate (0 to 1 and then 1 to 0). This can be repeated - and then all sectors are cleared (so 00 written) plus the test reads back and verifies the result, to confirm not only that all sectors are overwritten and readable - but that it contains the last written data (00 bytes in all positions).

You can control the amount of such alternating passes if you select Disk menu -> Surface test and in this window, on the Configuration tab, adjust the "Surface reinitialization level" value. It is 3 by default (so performing the above 1+2+3) before clearing and reading back. If you increase for example to 6, then the above steps 1+2 will be done three times before overwrite with 00 bytes (and read back).


> I saw under custom you have the option for reinitialization level 3 2 1
> and thought maybe that was a means to toggle which write sequences were being written or something like that?

Yes, these mean the total number of overwrite with these special patterns.


> you encouraged using the random data write pattern instead of all zeros.

Yes: if we overwrite only once (to save time) it may be good idea to overwrite with ANYTHING but not simple zeroes.
While simple zero overwrite is a good way to quickly delete all possible data and restore all sectors to empty stage (so the drive can be initialised like a new one) it may be not effective to force the disk drive to really perform overwrite of all sectors.
SSDs and some SMR drives may not perform real overwrite with zeroes, just mark internally that the affected sectors are "clean" (similarly as TRIM command would make a sector as "empty" on an SSD).
So if we want to ensure that all sectors are really overwritten (both to detect real write performance and/or to repair possible damaged drive or so) then the best is to use a non-zero overwrite pattern (and maybe then with a zero-pattern if we need an empty drive) OR use the Reinitialise Disk Surface test which performs multiple overwrites+clearing+verification in a single step.

Re: Reinitialization levels and custom write patterns

Posted: 2021.02.01. 15:46
by otter
I greatly appreciate your thoughtful response...especially your sharing the following
"some SSDs and some SMR drives may not perform real overwrite with zeroes, just mark internally that the affected sectors are "clean" (similarly as TRIM command would make a sector as "empty" on an SSD)."
Very good to know! Thanks again and keep up the stellar work.