{"id":17723768,"url":"https://github.com/ncw/stressdisk","last_synced_at":"2025-04-06T09:09:53.117Z","repository":{"id":4743572,"uuid":"5893110","full_name":"ncw/stressdisk","owner":"ncw","description":"Stress test your disks / memory cards / USB sticks before trusting your valuable data to them","archived":false,"fork":false,"pushed_at":"2023-06-26T09:50:51.000Z","size":48,"stargazers_count":342,"open_issues_count":6,"forks_count":32,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-06-20T17:33:45.442Z","etag":null,"topics":["disk","memory-cards","stress-test","testing-flash","usb-sticks"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ncw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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,"publiccode":null,"codemeta":null}},"created_at":"2012-09-20T21:15:58.000Z","updated_at":"2024-06-19T11:56:24.000Z","dependencies_parsed_at":"2024-06-20T17:27:42.224Z","dependency_job_id":null,"html_url":"https://github.com/ncw/stressdisk","commit_stats":{"total_commits":47,"total_committers":5,"mean_commits":9.4,"dds":"0.19148936170212771","last_synced_commit":"daaa039112931a86b8df2f259770081bfde8c5f7"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncw%2Fstressdisk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncw%2Fstressdisk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncw%2Fstressdisk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncw%2Fstressdisk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncw","download_url":"https://codeload.github.com/ncw/stressdisk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457803,"owners_count":20941906,"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","memory-cards","stress-test","testing-flash","usb-sticks"],"created_at":"2024-10-25T15:43:59.804Z","updated_at":"2025-04-06T09:09:53.088Z","avatar_url":"https://github.com/ncw.png","language":"Go","readme":"StressDisk\n==========\n\nThis is a program designed to stress test your disks and find failures\nin them.\n\nUse it to soak test your new disks / memory cards / USB sticks before\ntrusting your valuable data to it.\n\nUse it to soak test your new PC hardware also for the same reason.\n\nNote that it turns out to be quite a sensitive memory tester too so\nerrors can sometimes be caused by bad RAM in your computer rather than\ndisk errors.\n\nInstall\n-------\n\nStressDisk is a Go program and comes as a single binary file.\n\nDownload the relevant binary from\n\n- https://github.com/ncw/stressdisk/releases\n\nOr alternatively if you have Go installed use\n\n    go install github.com/ncw/stressdisk@latest\n\nIf you want to modify the sources, it is recommended to check out the repository.\n\n    git clone https://github.com/ncw/stressdisk.git\n    cd stressdisk\n    go build .\n\nYou can then modify the source, rebuild as needed, and submit patches.\n\nUsage\n-----\n\nUse `stressdisk -h` to see all the options.\n\n```\nDisk soak testing utility\n\nAutomatic usage:\n  stressdisk run directory            - auto fill the directory up and soak test it\n  stressdisk cycle directory          - fill, test, delete, repeat - torture for flash\n  stressdisk clean directory          - delete the check files from the directory\n\nManual usage:\n  stressdisk help                       - this help\n  stressdisk [ -s size ] write filename - write a check file\n  stressdisk read filename              - read the check file back\n  stressdisk reads filename             - ... repeatedly for duration set\n  stressdisk check filename1 filename2  - compare two check files\n  stressdisk checks filename1 filename2 - ... repeatedly for duration set\n\nFull options:\n  -cpuprofile string\n        Write cpu profile to file\n  -duration duration\n        Duration to run test (default 24h0m0s)\n  -logfile string\n        File to write log to set to empty to ignore (default \"stressdisk.log\")\n  -maxerrors uint\n        Max number of errors to print per file (default 64)\n  -nodirect\n        Don't use O_DIRECT\n  -s int\n        Size of the check files (default 1000000000)\n  -stats duration\n        Interval to print stats (default 1m0s)\n  -statsfile string\n        File to load/store statistics data (default \"stressdisk_stats.json\")\n\nNote that flags must be provided BEFORE the stressdisk command, eg\n  stressdisk -duration 48h run /mnt\n```\n\nQuickstart\n----------\n\nInstall your new media in your computer and format it (make a filesystem on it).\n\nOpen a terminal (or cmd prompt if running Windows).\n\nTo check the disk:\n\n    Linux: ./stressdisk run /media/nameofnewdisk\n    Windows: stressdisk.exe run F:\n\nLet it run for 24 hours.  It will finish on its own.  Note whether any errors\nwere reported.  Then use the following to remove the check files:\n\n    Linux: ./stressdisk clean /media/nameofnewdisk\n    Windows: stressdisk.exe clean F:\n\nIf you find errors, then you can use the `read` / `reads` / `check` /\n`checks` sub-commands to investigate further.\n\n    2012/09/20 22:23:20 Exiting after running for \u003e 30s\n    2012/09/20 22:23:20 \n    Bytes read:         20778 MByte ( 692.59 MByte/s)\n    Bytes written:          0 MByte (   0.00 MByte/s)\n    Errors:                 0\n    Elapsed time:  30.00033s\n    \n    2012/09/20 22:23:20 PASSED with no errors\n\nStress disk can be interrupted after it has written its check files\nand it will continue from where it left off.\n\nThe default running time for stressdisk is 24h which is a sensible\nminimum.  However if you want to run it for longer then use `-duration\n48h` for instance.\n\nErrors\n------\n\nIf stressdisk finds an error it will print lines like this:\n\n    2019/03/07 10:55:09 0AA00000: 2D, A1 diff 8C\n\nThe fields are `offset`, `file1 value`, `file 2 value` and the diff\nwhich is `file1_value XOR file2_value` all in hexadecimal.  The diff\nwill be a binary number for a single bit error so `01`, `02`, `04`,\n`08`, `10`, `20`, `40`, `80`.\n\nThis may give some insight into the problem (eg a single bit flipped),\nor errors starting 4k boundaries, but may not.\n\nHowever, the actual errors aren't that important, you shouldn't get\n**any**. If you do then:\n\n1. run [memtest86](https://www.memtest86.com/) on the machine for 48 hours to check for RAM problems, if this passes then\n2. try the stressdisk test on another machine if you can, if this fails then\n3. discard or return the media\n\nIf you didn't get to step 3. then you'll need to play with the\nhardware of the machine, replace the RAM etc.  Stressdisk errors are\n*usually* caused by bad media, but not always.  Bad RAM is a fairly\nlikely cause of stressdisk errors too.\n\nTesting Flash\n-------------\n\nStressdisk has a special mode which is good for giving flash / SSD\nmedia a hard time.  The normal \"run\" test will fill the disk and read\nthe files back continually which a good test but doesn't torture flash\nas much as it could as writing is a much more intensive operation for\nflash than reading.\n\nTo test flash / SSD harder \"cycle\" mode does lots of write cycles as\nwell as read cycles. It works by filling the media with test files\nverifying that the data is valid, deleting the test files, and\nrepeating the write + verify process continually.\n\n**Caution**: This will be destructive to flash media if run long periods\nof time, since flash devices have a limited number of writes per\nsector/cell.\n\n**This Is Intentional**!  You can use this to stress test flash harder.\n\nYou can also use this mode to find the breaking point of flash devices\nto determine what the lifetime of the media is if you are quality\ntesting flash media before making a bulk buy.  The `-statsfile` option\nis useful when doing this to save persistent stats to disk in case the\nprocess is interrupted.\n\nIf you are merely interested in doing a less destructive test of the\nflash device for data integrity, then should use the \"run\" mode, as\nthis mode only writes the check files once, and does reads operations\nto verify data integrity which have little destructive penalty.\n\n\nHow it works\n------------\n\nStressdisk fills up your disk with identical large files (1 GB by\ndefault) full of random data.  It then randomly chooses a pair of\nthese and reads them back checking they are the same.\n\nThis causes the disk head to seek backwards and forwards across the\ndisk surface very quickly which is the worst possible access pattern\nfor disk drives and flushes out errors.\n\nIt seems to work equally well for non-rotating media.\n\nThe access patterns are designed so that your computer won't cache the\ndata being read off the disk so your computer will be forced to read\nit off the disk.\n\nStressdisk uses OS specific commands to make sure the data isn't\ncached in RAM so that you won't just be testing your computer RAM.\n\nHistory\n-------\n\nI wrote the first version of stressdisk in about 1995 after\ndiscovering that the CD I had just written at great expense had bit\nerrors in it.  I discovered that my very expensive SCSI disk was\nreturning occasional errors.\n\nIt has been used over the years to soak test 1000s of disks, memory\ncards, usb sticks and found many with errors.  It has also found quite\na few memory errors (bad RAM).\n\nThe original stressdisk was written in C with a perl wrapper but it\nwas rather awkward to use because of that, so I re-wrote it in Go in\n2012 as an exercise in learning Go and so that I could distribute it\nin an easy to run single executable format.\n\nLicense\n-------\n\nThis is free software under the terms of MIT the license (check the\nCOPYING file included in this package).\n\nContact and support\n-------------------\n\nThe project website is at:\n\n- https://github.com/ncw/stressdisk\n\nThere you can file bug reports, ask for help or contribute patches.\n\nAuthors\n-------\n\n- Nick Craig-Wood \u003cnick@craig-wood.com\u003e\n- Tomás Senart \u003ctsenart@gmail.com\u003e\n- David Meador \u003cdave@meadorresearch.com\u003e\n\nContributors\n------------\n\n- Yves Junqueira for code review and helpful suggestions\n- dcabro for reporting the windows empty partition issue\n- Colin Lord for fixing documentation issues\n- Your name goes here!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncw%2Fstressdisk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncw%2Fstressdisk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncw%2Fstressdisk/lists"}