PDA

View Full Version : Testing hard drives


davmoo
08-21-2008, 11:33 PM
A while back I posted about my frustrations with a failed Seagate hard drive, which itself was a warranty replacement for a Seagate drive that failed earlier. The latest in the chain of replacement drives arrived on a shiny brown UPS truck today.

If I were testing a processor or a processor/motherboard/memory combo, I'd pull out Prime95 (I participate in the prime search anyway). If I were testing memory specifically, it would be MemTest86+ doing the deed.

Anyone got any good ideas for a hard drive test program? I'd like to thrash the snot out of the new drive for a few days before I depend on it for anything important.

slonkak
08-22-2008, 03:51 AM
install vista. That should thrash it pretty good. ;)

Seriously though, if it were me I'd boot to a Linux live cd just run a little loop to write randomness to the hd forever (or until you hit ctrl+c)


> tcsh
> while(1)
while? dd if=/dev/urandom of=/dev/sda
while? end


I like tcsh for my shell but you could accomplish the same using similar syntax in bash. As long as you don't start seeing I/O errors fly across the screen, you can assume the drive is ok.

davmoo
08-22-2008, 05:05 AM
Joking aside, neither of my Vista boxes have ever had the level of disk activity that everyone else claims to have. In fact, when all 4 are just sitting running background tasks and I'm not actively using them, the XP box and OS X box show far more drive activity than the Vista boxes.

burkhartmj
08-22-2008, 02:38 PM
Don't know if it works for seagate drives, but I've always used the Western Digital diagnostic tool they have on their website. It doesn't just attack the hard drive to test it's reliability, but it does check every individual cluster for any bad ones. Takes forever, but it's how I discovered without a doubt that my laptop's drive was on its way out before it was completely gone so I could get all my data off it.

gimpbully
08-22-2008, 05:46 PM
It's uh.. germain.. to mention that this will overwrite your hard drive and, more importantly, your first sectors first. I way to test an already formatted drive would be to actually mount the drive under a boot cd and replace the 'of=/dev/sda' with 'of=/blah'. Also, /dev/urandom is painfully slow, there's no need for anything random for a test like this, just use /dev/zero.

or, to bring a full FS test into this, I tend to do:

#!/bin/sh
mkdir -p /testing/
i=1
n=1
while [ $i -le 20 ]; do
n=1
echo $i
mkdir -p /testing/$i
while [ $n -le 20 ]; do
dd if=/dev/zero of=/testing/$i/$n bs=256k count=40
n=$(($n+1))
done
i=$(($i+1))
done


That'll get you a good workout on the metadata side as well as give you a solid profile of the disk's speed. This will populate around 4GB of data in the folder /testing across 421 on-disk structures.


install vista. That should thrash it pretty good. ;)

Seriously though, if it were me I'd boot to a Linux live cd just run a little loop to write randomness to the hd forever (or until you hit ctrl+c)


> tcsh
> while(1)
while? dd if=/dev/urandom of=/dev/sda
while? end


I like tcsh for my shell but you could accomplish the same using similar syntax in bash. As long as you don't start seeing I/O errors fly across the screen, you can assume the drive is ok.

darknessgp
08-22-2008, 05:56 PM
Don't know if it works for seagate drives, but I've always used the Western Digital diagnostic tool they have on their website. It doesn't just attack the hard drive to test it's reliability, but it does check every individual cluster for any bad ones. Takes forever, but it's how I discovered without a doubt that my laptop's drive was on its way out before it was completely gone so I could get all my data off it.

I agree with this method. Most manufacturers have hdd diagnostic tools on their websites. Just grab the one you need for which ever company (though some like WD will work on any hdd) and let it do it's thing.

slonkak
08-22-2008, 08:03 PM
Don't know if it works for seagate drives, but I've always used the Western Digital diagnostic tool they have on their website. It doesn't just attack the hard drive to test it's reliability, but it does check every individual cluster for any bad ones. Takes forever, but it's how I discovered without a doubt that my laptop's drive was on its way out before it was completely gone so I could get all my data off it.

The original question wasn't "is my drive broke," it was "is my drive reliable." Manufacturer test utils are good at answering whether or not it's broke, but it doesn't tell you anything about reliability.

The only way to make sure a hard drive is reliable is to write the hell out of it. That's why CPU burn programs exist for processors. You can test whether it's broke or not by trying to add 1+1, but that doesn't mean it can still add 1+1 when it's doing 2 million other things for 48 hours straight. (Stupid example, but you get the point).

fishtoprecords
08-23-2008, 03:33 AM
The only way to make sure a hard drive is reliable is to write the hell out of it.

Er, not quite. If you beat the heck out of it for a day, you have proven only that its robust enough to take a one day thrash.

There is no way to test to see when it will fail. You can only test that it isn't good enough to pass your test.

So the real answer is assume that a disk drive is not permanent, and have a real backup for anything critical.

davmoo
08-23-2008, 05:04 AM
Er, not quite. If you beat the heck out of it for a day, you have proven only that its robust enough to take a one day thrash.

The hard drive that was replaced lasted maybe 5 hours before it failed. Thus, a 24 or 48 hour test would give me a level of confidence in the new drive that I don't currently have. Especially if said test beat the living hell out of the drive.

petzl
08-23-2008, 01:18 PM
Try spin rite. It's not free but, it will test a drive to its limit with minimal chance of data loss. I've used it on occasion with flaky drives and new ones and it lives up to it's billing.

davmoo
08-23-2008, 01:42 PM
I hadn't thought of Spinrite, thanks for jogging my memory!

As it is though, at least for now, I took an alternate approach. I needed a drive to download a big bunch of files to, and its for my convenience more than anything else so it doesn't really matter if the drive then dies. I can always get the files from the original source. So the Seagate drive became "it".

fishtoprecords
08-24-2008, 04:20 AM
its for my convenience more than anything else

Sounds like a perfect application for RAID