Stress testing a new hard drive...
Tags hardware
You should always stress test a new harddrive when you buy it.
Some people say, "Just hook it up for a few months and keep unimportant data on it. If it breaks in that 1-3 month time then it will be good for 3 or 4 years."
While that metric is okay at best I prefer to take a more systematic approach to it. I want to fill the whole hard drive with random 1 and 0 over a constant and long period of time. I do that because you are stressing the hard drive out with max writes for a long period of time (I usually do it for 7 days before I'll pass the hard drive). If the hard drive fails within those 7 days then it was going to break within a month or two likely.
I encountered just that situation over the past day. Here are the scripts I ran to stress it out (run as root).
hdd-stress.sh
hdd-stress2.sh
hdd-stress-killall.sh
To run them just sub it so that it doesn't kill when you log out.
After 3 straight days of letting it run with a nice value of 0 here is the result from the tail of dmesg.
It's a good thing I did this before giving my brother his present. It would have been really annoying if he had to been the one to have to RMA it.
SAM
Some people say, "Just hook it up for a few months and keep unimportant data on it. If it breaks in that 1-3 month time then it will be good for 3 or 4 years."
While that metric is okay at best I prefer to take a more systematic approach to it. I want to fill the whole hard drive with random 1 and 0 over a constant and long period of time. I do that because you are stressing the hard drive out with max writes for a long period of time (I usually do it for 7 days before I'll pass the hard drive). If the hard drive fails within those 7 days then it was going to break within a month or two likely.
I encountered just that situation over the past day. Here are the scripts I ran to stress it out (run as root).
hdd-stress.sh
Code:
#!/bin/bash while true;do dd if=/dev/zero of=/dev/sdk &> /root/log.txt sleep 2 done
Code:
#!/bin/bash while true;do dd if=/dev/urandom of=/dev/sdk &> /root/log2.txt sleep 2 done
Code:
#!/bin/bash #kill the scripts ps aux | grep 'bash.*hdd' | grep -v 'grep' | awk '{print $2}' | xargs kill -15 killall dd
Code:
su - -c '/root/hdd-stress.sh &'
Code:
... it continues for a long time up ... [42931.558804] sd 7:0:0:0: [sdk] Unhandled error code [42931.558807] sd 7:0:0:0: [sdk] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK [42931.558812] sd 7:0:0:0: [sdk] CDB: Read(10): 28 00 e8 e0 88 a8 00 00 08 00 [42931.558821] end_request: I/O error, dev sdk, sector 3907029160 [42931.558825] Buffer I/O error on device sdk, logical block 488378645 [42931.565946] Buffer I/O error on device sdk, logical block 2 [42931.567031] Buffer I/O error on device sdk, logical block 3 [42931.568285] sd 7:0:0:0: [sdk] Unhandled error code [42931.568289] sd 7:0:0:0: [sdk] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK [42931.568295] sd 7:0:0:0: [sdk] CDB: Read(10): 28 00 00 00 00 00 00 00 20 00 [42931.568310] end_request: I/O error, dev sdk, sector 0 [42931.569451] Buffer I/O error on device sdk, logical block 0 [42931.570577] Buffer I/O error on device sdk, logical block 1 [42931.570615] sd 7:0:0:0: [sdk] Unhandled error code [42931.570619] sd 7:0:0:0: [sdk] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK [42931.570624] sd 7:0:0:0: [sdk] CDB: Read(10): 28 00 00 00 00 00 00 00 08 00 [42931.570634] end_request: I/O error, dev sdk, sector 0 [42931.570638] Buffer I/O error on device sdk, logical block 0
SAM
Total Comments 0