1nbdkit-random-plugin(1) NBDKIT nbdkit-random-plugin(1)
2
3
4
6 nbdkit-random-plugin - plugin to serve random data
7
9 nbdkit random [size=]SIZE [seed=SEED]
10
12 "nbdkit-random-plugin" is a plugin for nbdkit(1) which serves random
13 data. This plugin is mainly good for testing NBD clients. This plugin
14 creates a non-sparse random disk, for a sparse random disk see
15 nbdkit-sparse-random-plugin(1).
16
17 The size of the virtual disk must be specified using the "size"
18 parameter. If you specify the "seed" parameter then you will get the
19 same random data over multiple runs with the same seed.
20
21 The random data is generated using an insecure method.
22
23 Writes and testing copying
24 Writing to the disk is possible. If you do this the plugin will check
25 that what you are writing exactly matches what would be read at the
26 same offset (if not, it returns EIO error). You can use this to test
27 copying programs by making the source and destination NBD URIs be the
28 same:
29
30 nbdkit -U - random size=100M --run 'nbdcopy "$uri" "$uri"'
31
32 "qemu-img convert" could be used in place of nbdcopy. See also
33 nbdkit-checkwrite-filter(1).
34
36 [size=]SIZE
37 Specify the virtual size of the disk image.
38
39 This parameter is required.
40
41 "size=" is a magic config key and may be omitted in most cases.
42 See "Magic parameters" in nbdkit(1).
43
44 seed=SEED
45 Specify the random seed to get repeatable data over multiple runs.
46
47 If not specified then a random seed is chosen.
48
50 $plugindir/nbdkit-random-plugin.so
51 The plugin.
52
53 Use "nbdkit --dump-config" to find the location of $plugindir.
54
56 "nbdkit-random-plugin" first appeared in nbdkit 1.4.
57
59 nbdkit(1), nbdkit-plugin(3), nbdkit-data-plugin(1),
60 nbdkit-full-plugin(1), nbdkit-null-plugin(1), nbdkit-pattern-plugin(1),
61 nbdkit-sparse-random-plugin(1), nbdkit-zero-plugin(1), nbdcopy(1),
62 qemu-img(1).
63
65 Richard W.M. Jones
66
68 Copyright (C) 2018-2020 Red Hat Inc.
69
71 Redistribution and use in source and binary forms, with or without
72 modification, are permitted provided that the following conditions are
73 met:
74
75 · Redistributions of source code must retain the above copyright
76 notice, this list of conditions and the following disclaimer.
77
78 · Redistributions in binary form must reproduce the above copyright
79 notice, this list of conditions and the following disclaimer in the
80 documentation and/or other materials provided with the
81 distribution.
82
83 · Neither the name of Red Hat nor the names of its contributors may
84 be used to endorse or promote products derived from this software
85 without specific prior written permission.
86
87 THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
88 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
89 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
90 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
91 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
92 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
93 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
94 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
95 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
96 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
97 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
98
99
100
101nbdkit-1.24.2 2021-03-02 nbdkit-random-plugin(1)