This series is written by a representative of the latter group, which is comprised mostly of what might be called "productivity users" (perhaps "tinkerly productivity users?"). Though my lack of training precludes me from writing code or improving anyone else's, I can, nonetheless, try and figure out creative ways of utilizing open source programs. And again, because of my lack of expertise, though I may be capable of deploying open source programs in creative ways, my modest technical acumen hinders me from utilizing those programs in what may be the most optimal ways. The open-source character, then, of this series, consists in my presentation to the community of open source users and programmers of my own crude and halting attempts at accomplishing computing tasks, in the hope that those who are more knowledgeable than me can offer advice, alternatives, and corrections. The desired end result is the discovery, through a communal process, of optimal and/or alternate ways of accomplishing the sorts of tasks that I and other open source productivity users need to perform.

Friday, February 15, 2019

Stress-testing hard drives

This entry will consist mostly in someone else's content. The back story is that, about 3 years ago on the mythtv-users list-serv, one of the list members offered such a concise, straightforward, and apparently sound description of how she tests out new hard drives, that it remained in my memory.

Well, now that it has come time for me to replace an aging hard drive in my MythTV machine, it's time to dig out those directives and actually use them. And while I'm doing that, I may as well post them on this blog for future reference. Credit for the material goes to faginbagin/Helen, the user who posted it in the list-serv.

Without further ado, here is the content:
I look for drives with the longest warranty. This Christmas I bought 4 3TB HGST drives with 3 year warranties. Got to look close, because some only have 2 year warranties. Before I put any new drive into service, I use the following procedure to increase the chances it's a good drive
that will last. 
Capture SMART data via:
smartctl -a /dev/sdx > smart0.out 
Write semi random data on the whole drive with:
nohup shred -n1 -v /dev/sdx > shred.out & 
Go away for a couple of hours. Check shred.out and figure out how long
it will take to finish. Come back when it should be done. 
Read the whole drive and compute a checksum:
nohup md5sum /dev/sdx > md5sum.out & 
Go away for roughly the same time it took shred to write to the drive.
Read the whole drive again and make sure the checksum matches:
nohup md5sum -c md5sum.out > md5sum.chk & 
Go away for roughly the same time it took the first md5sum to read the
drive. 
Write zeros to the drive:
nohup dd if=/dev/zero of=/dev/sdx bs=1M > dd.out & 
Capture SMART data via:
smartctl -a /dev/sdx > smart1.out 
Compare the two smart runs:
diff smart0.out smart1.out 
Make sure there are no complaints about sectors. 
Make sure the kernel didn't report any errors:
dmesg| tail 
If no SMART or kernel reported errors, create partition table, create
partitions, mount, etc... 
If any errors, return immediately. 
 Original post located at http://lists.mythtv.org/pipermail/mythtv-users/2016-April/386438.html