{"id":13766244,"url":"https://github.com/zaggynl/hddtest","last_synced_at":"2025-05-10T21:33:16.766Z","repository":{"id":98437166,"uuid":"78202137","full_name":"zaggynl/hddtest","owner":"zaggynl","description":"HDD torture test for new disks","archived":false,"fork":false,"pushed_at":"2017-01-08T14:23:32.000Z","size":35,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-17T02:33:55.439Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zaggynl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-01-06T11:47:50.000Z","updated_at":"2017-01-06T11:49:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"e97c9b98-8906-4ce0-aff9-0b97a06b8b63","html_url":"https://github.com/zaggynl/hddtest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaggynl%2Fhddtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaggynl%2Fhddtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaggynl%2Fhddtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaggynl%2Fhddtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaggynl","download_url":"https://codeload.github.com/zaggynl/hddtest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253486307,"owners_count":21916134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T16:00:53.023Z","updated_at":"2025-05-10T21:33:16.491Z","avatar_url":"https://github.com/zaggynl.png","language":"Shell","funding_links":[],"categories":["Linux"],"sub_categories":["Storage"],"readme":"FreeNAS HDD torture test by The Gecko modified for Linux by zaggynl  \nOriginal FreeNAS script from: https://forums.freenas.org/index.php?threads/how-to-hard-drive-burn-in-testing.21451/page-5#post-191587  \n\n#Why are you torturing your disks??  \nWhen you receive a bunch of new disks you want to make sure they are all OK _before_ you put data on them.  \nThis script runs all SMART tests and then runs badblocks in destructive mode (bye existing data) to test for bad sectors.  \n\n#How do I know if a disk is bad?   \nErrors, lots of errors, check the SMART status with smartctl -a /dev/sda (where /dev/sda is the correct device) and check the output of badblocks.   \n\n\n#Things I changed in the original script:      \n-added check if tmux is installed, stop if missing    \n-added check if smartctl is installed, stop if missing     \n-stop if no disk specified  \n-confirm start as badblocks runs in destructive mode    \n-removed raw debug setting, not used in Linux?   \n-removed some commented code that was unused\n  \n#What does it do?   \nTest if tmux and smartctl are installed   \nCheck if a disk was specified     \nSet save path    \nVerify disk exists   \nSave and display drive model \u0026 serial number  \nConfirm start as badblocks runs in destructive mode  \nCheck if disk is mounted   \nCheck if this script is not already running for this disk  \nSpawn tmux session.  Name tmux session after disk device designation (ie. \"sda\")  \nCreate\"In-Progress\" status file  \nForcibly cancel any running SMART test for this disk   \nSave current SMART details to disk  \nStart SMART short test.  Write time stamp of completion to log file.  Sleep until complete.  \nStart SMART conveyance test.  Write time stamp of completion to log file.  Sleep until complete.    \nStart SMART long test.  Write time stamp of completion to log file.  Sleep until complete.    \nRun destructive badblocks test (default settings)  \nStart SMART long test.  Write time stamp of completion to log file.  Sleep until complete.   \nSave new SMART details to disk  \nRemove \"In-Progress\" Status File  \nCreate \"Completed\" Status File  \nDone  \n  \n#How to run it?  \nGive your pc a drive to hold files.  I mounted a USB drive and set it up as a standard volume with this path: /mnt/SystemDataset  \nPut the script in /mnt/SystemDataset  \nOpen the script and edit the variable 'Save_Path' to fit your environment  \nSet the script to be executable  \nCheck which disk you want to test:  \nhwinfo --disk  \nor  \nlshw --class disk --class storage  \nRun it like this:  \n ./hddtest.sh sda  \n#Script will disappear into background while it's running as it might take a long while  \nTo view status: tmux attach -t sda  \nTo detach: Ctrl+B,D  \nTo switch between sessions when running multiple test, attach then press Ctrl+B,S, use arrows keys and enter to switch   \n\n#I've canceled the script and now I can't restart it as it says it's already running, what do I do?   \nRemove the files it created, they start with the disk model   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaggynl%2Fhddtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaggynl%2Fhddtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaggynl%2Fhddtest/lists"}