]> disk-test




disk-test − Block device read-write test utility written in bash



[-a|--actions wvzr...]
[-b|--block-size blockSize]
[-c|--count-bytes numberOfBytes]
[-s|--skip-bytes numberOfBytes]

disk-test [--help]

Tests if a device can write and correctly read arbitrary data over its entire reported size, or over a specified range.


Performs an arbitrary sequence of actions on a device (or file), or on a data range on the device. The desired sequence of actions is given as a string of characters.
See option -a|--action for available actions.


-a|--actions wvzr...

The action(s) to perform, given as a concatenation of characters, where each character denotes an action.
Default: "r"
Available actions are:
wWrite pseudo-random data
v − Read and verify the data written by the most recent preceding write action
z − Write zeros
rRead, but do not verify, the data on the device
The "v" action may only be specified if a "w" or "z" action precedes it at any point, otherwise the application will immediately terminate with an exit code of 1.
The pseudo-random data varies for each "w" action and is generated by encrypting a stream of zeros with 256-bit AES in CTR mode, which should be reasonably fast and usually outperforms /dev/urandom.

-b|--block-size blockSize

The block size to use for reading and writing.
Default: "8M"
Is directly passed to "dd" as value for "ibs=" and "obs=".

-c|--count-bytes numberOfBytes

How many bytes to read or write for each action.
Default: The number of bytes from --skip-bytes to the end of the device
Is checked to not exceed the default value; if it does, the application will immediately terminate with an exit code of 1.

-s|--skip-bytes numberOfBytes

The 0-based byte index at which to start reading/writing for each action.
Default: 0


Exit code is 0

There were no errors, and the selected actions have been performed on the device successfully.

Exit code is 1

A fatal error occurred that prevented the application from performing its regular operation, e.g.
• No arguments or --help as single argument given
• Invalid --actions string
• Required programs are not available
• The given device or file to test does not exist
• Bad values for --skip-bytes or --count-bytes

Exit code is 2

The device failed any of the given --actions, e.g.
• I/O error
• A data verification failed



E-Mail: eomanis@web.de
PGP key fingerprint: F576 37E9 E5C2 8F91 EE64 277B 603E EF8F E0A9 9498


Copyright 2018-2020 eomanis

disk-test is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.

disk-test is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with disk-test. If not, see <http://www.gnu.org/licenses/>.


Should it be required to ascertain the identity of an author, the person who can prove to be in possession of the secret master key of an author’s PGP key is to be considered the respective author.

In case an author’s PGP key has been replaced by another PGP key, the person who can prove the key supersession in the most convincing manner is to be considered the respective author. For example, an author may document the existence of a properly signed key supersession declaration at a certain point in time in a provably tamper-proof way, such as embedding the declaration or a cryptographically secure hash of it in an irreversible blockchain.