nbdkit-evil-filter(1) | NBDKIT | nbdkit-evil-filter(1) |
nbdkit-evil-filter - add random data corruption to reads
nbdkit --filter=evil PLUGIN [PLUGIN-ARGS...] evil=[cosmic-rays|stuck-bits|stuck-wires] [evil-probability=PROB] [evil-stuck-probability=PROB] [evil-seed=SEED]
nbdkit-evil-filter is a Byzantine filter for nbdkit(1) that randomly corrupts data when reading from the underlying plugin. This can be used for testing filesystem checksums. Note that it does not change write operations, so the underlying plugin contains the correct data.
nbdkit-error-filter(1) is a related filter that injects hard errors into the NBD protocol.
This filter has several modes, controlled using the "evil=..." parameter. These are:
Fixed bits in the backing file are stuck randomly high or low. The "evil-probability" parameter controls the expected probability that a particular bit is stuck, defaulting in this mode to 1e-8 (1 in 100 million). "evil-stuck-probability" controls the probability that a stuck bit is read as its stuck value or its correct value, defaulting to 100% (always read as a stuck bit).
Add some stuck bits to the backing file at random:
nbdkit --filter=evil file disk.img
Cosmic rays will flip (on average) one in every 100 million bits copied from the backing file over NBD:
nbdkit --filter=evil file disk.img evil=cosmic-rays \ --run 'nbdcopy $uri output.img'
Plugins can be sparse. This filter only corrupts bits in non-sparse parts of the backing disk and it leaves sparse regions unchanged (which is realistic behaviour). If you wish to use this filter to corrupt sparse regions, then combine this filter with nbdkit-noextents-filter(1). For example:
nbdkit --filter=evil --filter=noextents memory 1G
The current implementation limits probabilities to the range [ 1e-12 .. 1/8 ]. Values below this range are treated the same as 0%. Values above this range are treated the same as 100%.
The default probability depends on the mode.
The default is to choose a seed at random.
Use "nbdkit --dump-config" to find the location of $filterdir.
"nbdkit-evil-filter" first appeared in nbdkit 1.36.
nbdkit(1), nbdkit-filter(3), nbdkit-delay-filter(1), nbdkit-noextents-filter(1), nbdkit-error-filter(1).
Richard W.M. Jones
Copyright Red Hat
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2024-03-31 | nbdkit-1.36.3 |