New Disk Stress Test6 min read

I bought a few new disks and wanted a better way to weed out marginal disks before I deployed them.

I don’t use UnRAID at home, but I liked the idea of their preclear script. I have modified it to remove a number of unnecessary options, but it works at this point, so I thought I would post it. How does it work?

The script:
* gets a SMART report
* pre-reads the entire disk
* writes zeros to the entire disk
* sets the special signature recognized by unRAID
* verifies the signature
* post-reads the entire disk
* optionally repeats the process for additional cycles (if you specified the “-c NN” option, where NN = a number from 1 to 20, default is to run 1 cycle)
* gets a final SMART report
* compares the SMART reports alerting you of differences.

It also has the option to run a (4) pass destructive write pass with badblocks. If a disk can make it through this, I can confidently use it in my fileserver. I’m still working on getting the options to work correctly, but it does run with the basic options at this point. By default, this option is on. This option can add 30 hours to the runtime on a large disk. If you want to turn it off, change the use_badblocks=1 at the beginning to say use_badblocks=0.

**WARNING: This will completely overwrite your disk!!!**
This does perform some sanity tests to make sure your disk is available, isn’t in use, or mounted before it runs.

You use it like this.

Here is the script.

Zack

Zack

I love learning new things and trying out the latest technology.

You may also like...

3 Responses

  1. srnoob says:

    Thanks for the script.

    I think WordPress has messed up the formatting though, eg the last line:

    echo -e “$report_out ” > /root/disk_test_results.txt

    I’m sure the “>” is meant to be a “>” symbol. There’s a lot more examples in the script as well.

  2. srnoob says:

    Wow, that’s funny, it came out correct in my comment. Anyway the ampersands and greater than symbols are being mangled. I took a screenshot at http://imgur.com/a/gPYnP

Leave a Reply