{"id":18054142,"url":"https://github.com/mbuesch/disktest","last_synced_at":"2025-04-06T12:11:07.324Z","repository":{"id":39695946,"uuid":"308925048","full_name":"mbuesch/disktest","owner":"mbuesch","description":"Solid State Disk (SSD), USB Stick, SD-Card, Hard Disk (HDD) tester","archived":false,"fork":false,"pushed_at":"2025-03-14T18:50:49.000Z","size":465,"stargazers_count":38,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T02:31:00.670Z","etag":null,"topics":["fraud-detection","harddisk","hdd","mmc","nvme","rust","sd-card","ssd","usb-drive","usb-stick"],"latest_commit_sha":null,"homepage":"https://bues.ch/h/disktest","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbuesch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2020-10-31T16:33:20.000Z","updated_at":"2025-03-14T18:50:53.000Z","dependencies_parsed_at":"2023-12-20T13:05:43.326Z","dependency_job_id":"63e7afa0-36b2-4fc6-96e7-12be2b259922","html_url":"https://github.com/mbuesch/disktest","commit_stats":{"total_commits":222,"total_committers":1,"mean_commits":222.0,"dds":0.0,"last_synced_commit":"03ef414daf815c897a73c7592cec4a132a779084"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbuesch%2Fdisktest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbuesch%2Fdisktest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbuesch%2Fdisktest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbuesch%2Fdisktest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbuesch","download_url":"https://codeload.github.com/mbuesch/disktest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478324,"owners_count":20945266,"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":["fraud-detection","harddisk","hdd","mmc","nvme","rust","sd-card","ssd","usb-drive","usb-stick"],"created_at":"2024-10-31T00:09:26.008Z","updated_at":"2025-04-06T12:11:07.306Z","avatar_url":"https://github.com/mbuesch.png","language":"Rust","readme":"# disktest - Tester for Solid State Disk (SSD), Non-Volatile Memory Storage (NVMe), Hard Disk (HDD), USB Stick, SD-Card, etc...\n\n[Homepage](https://bues.ch/h/disktest)\n\n[Git repository](https://bues.ch/cgit/disktest.git)\n\n[Github repository](https://github.com/mbuesch/disktest)\n\n[crates.io site](https://crates.io/crates/disktest)\n\n\nDisktest is a tool to check Solid State Disks, Non-Volatile Memory Storage, Hard Disks, USB sticks, SD cards or other storage media for errors.\n\nIt does so by writing a pseudo random sequence to the device and then reading it back and verifying it to the same pseudo random sequence.\n\nThis tool can be used to:\n\n- Check disks for hardware errors (e.g. platter errors, flash errors, etc...).\n- Overwrite storage media with a cryptographically strong pseudo random stream. This can either be used to delete existing data on the disk, or to prepare the disk for encryption.\n- Test for tampered media that pretend to have more storage area than they physically actually have. Sometimes such media are sold by fraudulent sellers for cheap prices.\n- Measure read and write speed.\n- ... probably lots of other tasks.\n\nThe random number stream is generated by the following algorithm:\n\n```\nOUTPUT_DATA := CHACHA20(PBKDF2(SEED | THREAD_ID | ROUND_ID))\n```\n\nIf more than one thread is used, then each thread generates such a random number stream, which are then interleaved in an alternating pattern.\n\n\n# Security\n\nThe default algorithm [ChaCha20](https://en.wikipedia.org/wiki/Salsa20) is a cryptographically strong random number generator. That means if the seed is kept secret, then the random sequence cannot be predicted or reconstructed by anybody else.\n\nSee option `--seed` under `--help` for more details.\n\n\n# Linux example\n\nThe following disktest invocation will write a secure sequence to the disk device `/dev/sdc` and subsequently read back and verify the sequence from the disk device.\n\n```sh\ndisktest --write --verify -j0 /dev/sdc\n```\n\nFor NVMe:\n\n```sh\ndisktest --write --verify -j0 /dev/nvme0n1\n```\n\nFor SD / MMC:\n\n```sh\ndisktest --write --verify -j0 /dev/mmcblk0\n```\n\n*WARNING*: This will irrevocably overwrite all data on the storage device! Be absolutely certain that the device path is correct before starting the command. Your data cannot be recovered.\n\nYou probably need `root` permissions to write to raw disk devices (`/dev/sdX`, `/dev/nvmeXn1` or `/dev/mmcblkX`).\n\nThe target `device` does not have to be an actual hardware device node. It can be any file path on any file system. For example you can mount an USB stick file system and write to a file on that file system. However, please note that this leaves a couple minor untested spots in the USB stick's memory, which are reserved to the file system. Also see the `Windows` section below.\n\n\n# Windows example\n\nOn Windows disktest can write to any file on any mounted storage media or raw disks.\n\nIf your storage media under test is drive E, then the following command would write a test file on drive E and verify it:\n\n```sh\ndisktest --write --verify -j0 E:\\testfile.img\n```\n\nBut note that testing on filesystem level like above does not test the full device.\nIt will omit the disk areas the filesystem uses internally.\nTherefore, you may want to write to the raw disk E with the Windows raw drive notation as follows:\n\n```sh\ndisktest --write --verify -j0 \\\\.\\E:\n```\n\nor\n\n```sh\ndisktest --write --verify -j0 \\\\.\\PhysicalDrive2\n```\n\nDoing so will completely wipe all data (including the filesystem) on this disk.\n\nAlways make sure that you selected the correct drive.\nEspecially in the `\\\\\\\\.\\PhysicalDriveX` notation it is extremely easy to overwrite the wrong drive by accident.\nTherefore, the `\\\\\\\\.\\X:` (where X is the drive letter) notation is preferred.\n\n\n# Dependencies\n\n- [Rust 1.75.0](https://www.rust-lang.org/) or later.\n- Crate dependencies will automatically be downloaded by cargo.\n\n\n# Installing from crates.io\n\nDownload the latest version of disktest from [crates.io](https://crates.io/) and install it to `$HOME/.cargo/bin`:\n\n```sh\ncargo install disktest\n```\n\n\n# Installing from source package\n\nBuild disktest and install it to `$HOME/.cargo/bin`:\n\n```sh\ncd path/to/source/package\ncargo install --path .\n```\n\n\n# Running from source package without installing\n\nBuild and run disktest in place without installing it:\n\n```sh\ncd path/to/source/package\ncargo run --release --  DISKTEST_OPTIONS_HERE\n```\n\nSee below for a description of the available `disktest` options.\n\n\n# Disktest command line options\n\nPlease run either of the following commands to show more information about the available command line options.\n\n```sh\ncargo run --release -- --help\ndisktest --help\n```\n\n\n# Speed\n\nThe following table shows some example speed measurements of disktest in various operation mode on different hardware.\n\nThese speed tests don't write to an actual disk, but only to the `/dev/null` device, which is a device that does nothing. So these speed test results do not include the speed limits of any actual disk hardware.\n\n| Command                               | Algorithm | Hardware                        | Data rate written |\n| ------------------------------------- | --------- | ------------------------------- | ----------------- |\n| disktest -j12 -ACHACHA20 -w /dev/null | ChaCha20  | AMD Ryzen 5 5500U; 6x2 cores    | 8.1 GiB/s         |\n| disktest -j12 -ACHACHA12 -w /dev/null | ChaCha12  | AMD Ryzen 5 5500U; 6x2 cores    | 8.2 GiB/s         |\n| disktest -j12 -ACHACHA8 -w /dev/null  | ChaCha8   | AMD Ryzen 5 5500U; 6x2 cores    | 8.3 GiB/s         |\n| disktest -j12 -ACRC -w /dev/null      | CRC       | AMD Ryzen 5 5500U; 6x2 cores    | 8.4 GiB/s         |\n| disktest -j4 -ACHACHA20 -w /dev/null  | ChaCha20  | Intel i5-3320M; 2x2 cores       | 2.1 GiB/s         |\n| disktest -j4 -ACHACHA12 -w /dev/null  | ChaCha12  | Intel i5-3320M; 2x2 cores       | 3.2 GiB/s         |\n| disktest -j4 -ACHACHA8 -w /dev/null   | ChaCha8   | Intel i5-3320M; 2x2 cores       | 4.4 GiB/s         |\n| disktest -j4 -ACRC -w /dev/null       | CRC       | Intel i5-3320M; 2x2 cores       | 7.5 GiB/s         |\n| disktest -j4 -ACHACHA20 -w /dev/null  | ChaCha20  | Raspberry Pi 4; 4 cores 1.5 GHz | 420 MiB/s         |\n| disktest -j4 -ACHACHA12 -w /dev/null  | ChaCha12  | Raspberry Pi 4; 4 cores 1.5 GHz | 670 MiB/s         |\n| disktest -j4 -ACHACHA8 -w /dev/null   | ChaCha8   | Raspberry Pi 4; 4 cores 1.5 GHz | 920 MiB/s         |\n| disktest -j4 -ACRC -w /dev/null       | CRC       | Raspberry Pi 4; 4 cores 1.5 GHz | 2.5 GiB/s         |\n\nThe read data rates are similar, because the algorithm used is exactly the same.\n\n\n# License\n\nCopyright (c) 2020-2024 Michael Büsch \u003cm@bues.ch\u003e\n\nLicensed under the Apache License version 2.0 or the MIT license, at your option.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbuesch%2Fdisktest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbuesch%2Fdisktest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbuesch%2Fdisktest/lists"}