I want to build a storage server and bought 10 x 2TB WD RED's. The HDD's just arrived.

Is there any tool you guys use to check for bad drives or to best defend against infant mortality before copying real data on to your disks?

Is it better to check each single HDD or to test the array (ZFS raid-z2) through copying a lot of data on it?

  • 1
    I know there are some vendor specific tools like "WD Data LifeGuard Diagnostics". But I wonder what the guys do, that buy a whole lot of harddisks. I doubt they check every single hard drive (that takes a lot of time ..) so I wonder if there is a tool that can perform a full S.M.A.R.T test on all harddisks at once?
    – s1lv3r
    Apr 23 '13 at 10:17
  • 3
    Just about anything that writes to the drives can be used as a test; a full swipe or two of the the array should be sufficient to catch infant mortality. It's a really good idea to buy drives from different vendors/batches when you're getting more than a couple - significantly decreases chances of several drives failing at the same time (due to similar manufacturing defects).
    – Chris S
    Apr 23 '13 at 12:36

I had the same question 2 months ago. After sending in a failed disk, the replacement disk failed in my NAS after 3 days. So I decided I would now test the new replacement before putting it in production. I do not test every new disk I buy, only on 'refurbished' disks, which I do not completely trust.

If you decide you want to test these disks I would recommend running a badblocks scan and an extended SMART test on the brand new hard disk.

On a 2TB disk this takes up to 48 hours, The badblock command writes the disk full with a pattern, then reads the blocks again to see if the pattern is actually there, and will repeat this with 4 different patterns.

This command will probably not actually show up any bad blocks on a new disk, since disks reallocate bad blocks these days.

So before and after this I ran a smart test, and check the reallocated and current pending sector count. If any of these have gone up, your disk has some bad blocks already and so might prove untrustworthy.

After this I run an extended SMART test again.

You might want to install smartctl or smartmontools first.

Warning, the badblocks -w flag will overwrite all data on your disk, if you just want to do a read check, without overwriting the disk, use badblocks -vs /dev/sdX

sudo smartctl -a /dev/sdX
# record these numbers
sudo badblocks -wvs /dev/sdX
# let it run for 48 hours
sudo smartctl -a /dev/sdX
# compare numbers
sudo smartctl -t long /dev/sdX
# this might take another hour or 2, check results periodically with
sudo smartctl -a /dev/sdX

If after this your smart values seem ok I would trust the disk.

To know what each smart value means, you can start looking here


  • As the others supposed this may be doing far to much, but as I only have 10 disks and it certainly can't do any bad, I'm just checking all disks in the way you suggested now. Thank you for your comprehensive answer.
    – s1lv3r
    Apr 26 '13 at 14:48

These are new disks. Either they're going to fail or they won't. You're already a huge step ahead by using the ZFS filesystem, which will give you great insight into your raid and filesystem health...

I wouldn't do anything beyond just building the array. That's the point of the redundancy. You're not going to be able to induce a drive failure with the other listed methods.

  • 1
    Agreed with this - you're building an array. If a drive fails when you start putting data on, then it doesn't matter, you replace it and the array self-heals. Testing the drives for problems before using them is not going to give you a proper idea of whether they will fail in real life - real life ain't like tests!
    – Ashley
    Apr 26 '13 at 10:07
  • 1
    i agree "real life ain't like tests" but i have also found two drive failures via badblocks. Had i put both of those into the same part of a RAID 1, 5, or 10, i would have lost the whole RAID.
    – rjt
    May 9 '13 at 16:47
  • 1
    @rjt probably not. Bad sectors would be reallocated and the drives would not have likely failed at the same time. Plus, not all drive failures are media or a result of bad blocks. What if the drive bearing wears out or malfunctions?
    – ewwhite
    May 9 '13 at 18:45
  • i do not make decisions about mission critical data on probably. The Google Hard Drive Study says that drives either wear out in the first 90 days or after 3 years. badblocks help eliminate the low hanging fruit.
    – rjt
    May 9 '13 at 18:59
  • 1
    @rjt Of course you make decisions about mission-critical data on "probably" -- If you didn't you would be unable to store data on any drive, regardless of how much testing you do.
    – voretaq7
    May 9 '13 at 20:31

You can use Bonnie++ for testing. It can perfectly emulate file server behavior pattern.

For example:

# bonnie++ -u nobody -d /home/tmp -n 100:150000:200:100 -x 300

Test will run as user 'nobody' and will create/rewrite/delete 100*1024 files, from 200 to 150000 bytes per file, within 100 autocreated directories below /home/tmp. And number of tests = 300. You can play around file count/size and number of test repeats.


I work for a company that does this sort of testing day in and day out. And Yes, we test every single hard drive we buy. Our process starts with running the drives through a free DOS based program called HDAT2. Its free to download. It can access SMART and some other features of the drive that are inaccessible from a Windows environment. Depending on the results there we will run them through one of several different lines of specialized hardware, but at the core they mostly just run SMART short self test, Long Test, a secure erase and an All Read to verify the sectors. My suggestion is would be to run a secure erase of the full disk, then run an all read, then a SMART short self-test. This order is important as a short self-test may not find anything if run at the beginning of your testing but after a full write and read of the disc it may pick up something. Hope this helps.

  • 1
    serverfault.com/a/501870/117546 makes the most sense to me, but I am not an expert. Why does your company test the hard drives. I would think that the most effective test would be actually using the drive.
    – emory
    Apr 24 '13 at 1:49

I usually just do a full RAID init and where applicable, begin to populate the file system during this, all the time knowing that there might be a problem due to dead drives . This way, I don't waste any time for some kind of tests that are quite unreliable anyway and I would catch the real weak drives immediately. After that, there might be still some elevated chance for drive failures due to "infant mortality", but there is no practical way to eliminate this.

In practice, none of the last few hundred disks I used in a RAID had any issues during the first year of operation.


You could use the manufacturers test suite, or something like SpinRite to sweep the whole disk. It would also be a good idea to look at the SMART values, looking for bad sectors and other old-age/failure signs.


If you really want to test, then use badblocks write test. It will write data patterns to disk then read them to check. During this it will stress your disk a bit. In my opinion, if it runs succesfully you can trust the disk.

But I think ZFS and good backup is enough.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.