1

man badblocks says:

   -n     Use non-destructive read-write mode.  By default only a non-
          destructive read-only test is done.  This option must not be
          combined with the -w option, as they are mutually exclusive.

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.

What pattern(s) are used by -n if none are explicitly specified by -t?

Tom Hale
  • 30,455

1 Answers1

2

The default pattern with -n is a random pattern:

const unsigned int patterns[] = { ~0 };

(see pattern_fill for the equivalence to “random”).

In destructive mode, four patterns are used:

const unsigned int patterns[] = {0xaa, 0x55, 0xff, 0x00};
Stephen Kitt
  • 434,908