README.rst 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. disktest - Hard Disk (HDD), Solid State Disk (SSD), USB Stick, Memory Card (e.g. SD-Card) tester
  2. ================================================================================================
  3. `https://bues.ch/h/disktest <https://bues.ch/h/disktest>`_
  4. Disktest is a tool to check Hard Disks, Solid State Disks, USB sticks, SD cards or similar storage media for errors.
  5. It does so by writing a pseudo random sequence to the device and then reading it back and verifying it to the expected pseudo random sequence.
  6. This tool can be used to:
  7. * Check disks for hardware errors (e.g. platter errors, Flash errors, etc...).
  8. * 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.
  9. * 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.
  10. * ... probably lots of other tasks.
  11. The random number stream is a concatenation of hashes generated by the following algorithm:
  12. ::
  13. S = PBKDF2(SEED | THREAD_ID)
  14. HASH_DATA = SHA512(S | PREVIOUS_HASH_DATA | MONOTONIC_INC_COUNTER)
  15. If more than one thread is used, then each thread generates such a hash stream, which are then interleaved in a regular
  16. pattern.
  17. The algorithm can also be switched to a CRC based algorithm, that is much faster, but *not* cryptographically secure. However CRC is sufficient to find physical disk errors. Disktest defaults to the secure SHA512 based algorithm.
  18. Dependencies
  19. ============
  20. * `Rust (edition 2018) <https://www.rust-lang.org/>`_ or later.
  21. * Crate dependencies will automatically be downloaded by cargo.
  22. Running without installing
  23. ==========================
  24. Build and run disktest in place without installing it:
  25. .. code:: sh
  26. cargo run --release -- DISKTEST_OPTIONS_HERE
  27. See below for a description of the available `disktest` options.
  28. Installing
  29. ==========
  30. Build disktest and install it to `$HOME/.cargo/bin`:
  31. .. code:: sh
  32. cargo install --path .
  33. Disktest command line options
  34. =============================
  35. Please run either of the following commands to show more information about the available command line options.
  36. .. code:: sh
  37. cargo run --release -- --help
  38. cargo run --release -- -h
  39. disktest --help
  40. disktest -h
  41. Speed
  42. =====
  43. The following table shows some example speed measurements of disktest in various operation mode on different hardware.
  44. These 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.
  45. =============================== ========= ======================================= =================
  46. Command Algorithm Hardware Data rate written
  47. =============================== ========= ======================================= =================
  48. disktest -j6 -w /dev/null SHA512 AMD Phenom II X6 1090T; 6 cores 3.2 GHz 675 MiB/s
  49. disktest -j6 -ACRC -w /dev/null CRC AMD Phenom II X6 1090T; 6 cores 3.2 GHz 4.6 GiB/s
  50. disktest -j4 -w /dev/null SHA512 Intel i5-3320M; 2+2 cores 2.6 GHz 250 MiB/s
  51. disktest -j4 -ACRC -w /dev/null CRC Intel i5-3320M; 2+2 cores 2.6 GHz 3.4 GiB/s
  52. disktest -j4 -w /dev/null SHA512 Raspberry Pi 4; 4 cores 1.5 GHz 75 MiB/s
  53. disktest -j4 -ACRC -w /dev/null CRC Raspberry Pi 4; 4 cores 1.5 GHz 605 MiB/s
  54. =============================== ========= ======================================= =================
  55. The read data rates are similar, because the algorithm used is exactly the same.
  56. Note: The default rust compiler shipped with Raspberry Pi OS is too old to compile Disktest. A newer Rust compiler must be used on Raspberry Pi.
  57. License
  58. =======
  59. Copyright (c) 2020 Michael Buesch <m@bues.ch>
  60. Licensed under the terms of the GNU General Public License version 2, or (at your option) any later version.