What rituals should be performed when using a new HDD?



It is difficult to determine whether a new hard drive you purchased to replace the hard drive on your PC or your company's server is 'trustworthy'.

IronicBadger, who has been managing a Linux server for the past 10 years and replacing more than 20 HDDs, talks about the 'ritual' of such a new HDD purchase.

New Hard Drive rituals
https://blog.linuxserver.io/2018/10/29/new-hard-drive-rituals/

IronicBadger suffered a Seagate HDD failure in 2009 and lost all data stored on the HDD. Also, it seems that the HDD that seemed to be OK when purchased had a bad sector after a while, and in severe cases it failed in less than a day after turning on the power.



From that experience, IronicBadger

says that he performs a stress test on the HDD using badblocks every time and does not save any data on the HDD until the test is cleared. The basic usage of badblocks is also introduced. If you specify 'w' option to perform 'destructive write test', 's' option to 'show progress bar', and 'v' option to 'output bad sectors detected to standard output', ArchWiki Is described in.

[code] badblocks -b 4096 -wsv / dev / sdX [/ code]



The following shell script is used by IronicBadger when using badblocks. By running this script, it is possible to perform a test by combining smartctl and badblocks, and you can obtain relatively high certainty that 'the HDD will not fail for a while'.

GitHub-Spearfoot / disk-burnin-and-testing: Shell script for burn-in and testing of new or re-purposed drives
https://github.com/Spearfoot/disk-burnin-and-testing

Testing using badblocks seems to take a full week to complete for an 8TB HDD, so it is necessary to test with plenty of time. IronicBadger also recommends a server connection using tmux when performing this ritual. Using tmux, you can split the terminal window to monitor the test status of multiple HDDs simultaneously, or reconnect to the server and check the command execution status even if the server is disconnected. You.

in Hardware, Posted by darkhorse_log