man badblocks
says:
-n Use non-destructive read-write mode.
This answer says:
The non-destructive read-write test works by overwriting data, then reading to verify, and then writing the original data back afterwards.
Is there any way to allow for recovery should badblocks
be interrupted (eg kernel hang) during or after writing the test data but before it has written back the original data?
badblocks
is simply saving the original data into a memory buffer, not anywhere on another disk/partition from where it could be restored in the case of a SIGKILL or kernel hang. – Feb 12 '19 at 10:46