{"id":27197415,"url":"https://github.com/jamesabaker/hard-drive-defib","last_synced_at":"2025-04-09T20:28:29.198Z","repository":{"id":28888385,"uuid":"32413034","full_name":"JamesABaker/Hard-drive-defib","owner":"JamesABaker","description":"A few lines of code that randomly write on a hard drive. In some cases of deep formatting errors this can kick start the hard drive. This should be a last resort measure for disk recovery and will result in complete loss of data of the drive.","archived":false,"fork":false,"pushed_at":"2019-05-15T13:18:01.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-06T21:47:36.449Z","etag":null,"topics":["disk","hdd","shell"],"latest_commit_sha":null,"homepage":"","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/JamesABaker.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}},"created_at":"2015-03-17T18:43:08.000Z","updated_at":"2022-11-08T22:28:28.000Z","dependencies_parsed_at":"2022-08-02T12:20:39.903Z","dependency_job_id":null,"html_url":"https://github.com/JamesABaker/Hard-drive-defib","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/JamesABaker%2FHard-drive-defib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesABaker%2FHard-drive-defib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesABaker%2FHard-drive-defib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesABaker%2FHard-drive-defib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesABaker","download_url":"https://codeload.github.com/JamesABaker/Hard-drive-defib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248106566,"owners_count":21048756,"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":["disk","hdd","shell"],"created_at":"2025-04-09T20:28:28.649Z","updated_at":"2025-04-09T20:28:29.184Z","avatar_url":"https://github.com/JamesABaker.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"*This project starded from a modified local script heavily based on a [mac issues article by Topher Kessler](http://www.macissues.com/2014/04/05/how-to-fix-deep-formatting-problems-with-os-x-drives/).*\n\n\n# Hard drives are not ideal.\n\nIt's *hard* to take the eject messages seriously since 99.9% of the time everything is fine. But sometimes it goes wrong. ***REALLY*** wrong. Sometimes all you want to do is start over, but the wussy osx macbook won't let you.\n\nThis is a last resort little script that completely fecks up a hard drive by attempting to randomly write over it. However the idea is that it \"unsticks\" the hard drive. Then you can start again from some sort of diskutil thing.\n\n**Be careful which disk you attack!** By default the script *\"attacks\"* `dev/disk2` so you'll need to change this to whatever disk is causing you problems. You should already know which one is causing the problems. Use `diskutil list` just to be sure.\n\n\n\n## Running\n\n 1. `cd` to the download directory and run the following command to make the script executable:\n\n `chmod 777 deep.sh`\n\n 2. Now switch to root in the Terminal\n\n `sudo su`\n\n 3. And finally run the script, immediately followed by attaching your drive to the Mac:\n\n `./deep.sh`\n\n 4. Plug in the hard drive.\n\n 5. Wait for the script to stop for a bit, then close the terminal and terminate processes.\n\n 6.Get out of root by closing the terminal or ctrl C/D (I forget which)\n\n 7. Run `diskutil eraseDisk JHFS+ Test /dev/disk2` again being careful to check which disk needs erasing (it may have changed since last time you checked `diskutil list`). The disk is now as good as new and **all your old data is gone**.\n\n 8. Check your activity monitor. If you see `bash` running it means the loop is still going (unless you ran some other bash script with root permission). If `bash` is still running in root then run:\n\n `sudo killall bash`\n\n 9. Pray that this works otherwise it's a hardware thing...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesabaker%2Fhard-drive-defib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesabaker%2Fhard-drive-defib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesabaker%2Fhard-drive-defib/lists"}