I recently ran
badblocks on a large server hard drive to check for possible issues (SMART reported that everything was fine, but I needed to be sure).
The command I used was:
badblocks -c 1024 -b 4096 -w -s -o /path/to/myfile.txt /dev/mydrive
I used destructive-write mode because the downtime of the drive was important, and we determined that it would be faster to nuke the drive during the bad-blocks check and then re-add it to the RAID it had been a part of later than wait on the non-destructive test.
When it completed,
myfile.txt had been created but was empty.
This seems like a very silly question, but: the file being empty indicates that no bad blocks were found, correct? The manpage for
badblocks seems to indicate this, but I want to be as sure as I can be.