]>
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
CONFIGURATION FILES
EXIT CODES
AUTHOR
COPYRIGHT
IDENTITIES OF AUTHORS
disk-test - Block device read-write test utility written in bash
disk-test
[-a|--actions wvzr...]
[-b|--block-size blockSize]
[-c|--count-bytes numberOfBytes]
[-s|--skip-bytes numberOfBytes]
[--]
deviceOrFile
disk-test --help
disk-test --version
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/file. 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"
Example: "wvzv"
Available actions are:
• w - Write pseudo-random data
• v - Read and verify the data written by
the most recent preceding write action
• z - Write zeros
• r - Read, 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
--help |
Print a help message to STDOUT and exit with code 0. |
--version
Print the version string to STDOUT and exit with code 0.
Apart from providing arguments one can also set the various options through configuration files that are sourced by disk-test.
Insofar as they exist disk-test first reads these configuration files, in this order, wildcards expanded alphabetically:
•
/usr/lib/disk-test/disk-test.d/*.conf
• /usr/lib/disk-test/disk-test.conf
• /etc/disk-test/disk-test.d/*.conf
• /etc/disk-test/disk-test.conf
• /run/disk-test/disk-test.d/*.conf
• /run/disk-test/disk-test.conf
• ˜/.config/disk-test/disk-test.d/*.conf
• ˜/.config/disk-test/disk-test.conf
As is the case with sourcing, subsequent files may overwrite options that have been set by their predecessors. Also, after the configuration files have been sourced, the command line arguments are evaluated and in turn take precedence over anything that has been set in a configuration file.
In configuration
files, options are set by globally setting an option’s
corresponding variable to the desired value.
The variables are "camelCased" derivations of
their respective long --command-line-argument:
• blockSize for argument --block-size
To set e.g. 16M as block size one would put this into a configuration file:
blockSize=’16M’
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 operation,
e.g.
• No arguments 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.
• An I/O error occurred
• A read-and-verify (v) action encountered different
data than expected
eomanis
E-Mail: eomanis@web.de
PGP key fingerprint: F576 37E9 E5C2 8F91 EE64 277B 603E EF8F
E0A9 9498
Copyright 2018-2020, 2025 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.