I am using badblocks to simultaneously (a) checking a disk for errors, and (b) do a destructive erase of any data on the disk; using the following command:
badblocks -wsp 0 /dev/sdb1
I passed the option
-p 0 in the hopes that this would result in only a single pass, but I am getting multiple passes:
Testing with pattern 0xaa: done Reading and comparing: done Testing with pattern 0x55: done Reading and comparing: done Testing with pattern 0xff: done Reading and comparing: 19.01% done, 7:43:47 elapsed. (0/0/0 errors)
From reading the manpage, I can see that the
-w option itself includes four passes:
-w Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents. This option may not be combined with the -n option, as they are mutually exclusive.
This is excessive for my needs. Is there any way to achieve a single destructive pass?