1nbdkit-sparse-random-plugin(1) NBDKIT nbdkit-sparse-random-plugin(1)
2
3
4
6 nbdkit-sparse-random-plugin - make sparse random disks
7
9 nbdkit sparse-random [size=]SIZE [seed=SEED] [percent=N] [runlength=N]
10
12 "nbdkit-sparse-random-plugin" is a plugin for nbdkit(1) which makes
13 disks containing sparse blocks of random data. These disks have a
14 similar shape to virtual machine disks, and this plugin can be used to
15 benchmark disk copying tools like nbdcopy(1). To get a non-sparse
16 random disk, see nbdkit-random-plugin(1).
17
18 The size of the virtual disk must be specified using the "size"
19 parameter. If you specify the "seed" parameter then you will get the
20 same random data over multiple runs with the same seed.
21
22 The "percent" parameter controls the percentage of the disk which
23 contains random data versus sparse empty space.
24
25 The plugin does not generate random data spread evenly over the disk.
26 Instead to make it look more like a real virtual machine disk, it tries
27 to create runs of data and runs of empty space. The "runlength"
28 parameter controls the average length of each run of random data.
29
30 The random data is generated using an insecure method.
31
32 Writes and testing copying
33 Writes to the disk verify that the data written is the same as the data
34 read (if not, returning EIO). Thus when testing copies you can use a
35 single instance of this plugin for both read and write:
36
37 nbdkit -U - sparse-random size=1T --run 'nbdcopy "$uri" "$uri"'
38
39 "qemu-img convert" could be used in place of nbdcopy. See also
40 nbdkit-checkwrite-filter(1).
41
43 percent=N
44 Specify the approximate percentage of the disk which contains
45 random data versus sparse empty space. The default is 10 (10%).
46 "percent=0" will create a completely empty disk and "percent=100"
47 will create a completely full disk.
48
49 runlength=N
50 Specify the average length of runs of random data. This is
51 expressed in bytes and the usual modifiers can be used. The
52 default is 16M, meaning that (on average) data runs will be 16
53 megabytes in length.
54
55 seed=SEED
56 Specify the random seed to get repeatable data over multiple runs.
57
58 If not specified then a random seed is chosen.
59
60 [size=]SIZE
61 Specify the virtual size of the disk image.
62
63 This parameter is required.
64
65 "size=" is a magic config key and may be omitted in most cases.
66 See "Magic parameters" in nbdkit(1).
67
69 $plugindir/nbdkit-sparse-random-plugin.so
70 The plugin.
71
72 Use "nbdkit --dump-config" to find the location of $plugindir.
73
75 "nbdkit-sparse-random-plugin" first appeared in nbdkit 1.24.
76
78 nbdkit(1), nbdkit-plugin(3), nbdkit-data-plugin(1),
79 nbdkit-full-plugin(1), nbdkit-null-plugin(1), nbdkit-pattern-plugin(1),
80 nbdkit-random-plugin(1), nbdkit-zero-plugin(1), nbdcopy(1),
81 qemu-img(1).
82
84 Richard W.M. Jones
85
87 Copyright (C) 2018 Red Hat Inc.
88
90 Redistribution and use in source and binary forms, with or without
91 modification, are permitted provided that the following conditions are
92 met:
93
94 • Redistributions of source code must retain the above copyright
95 notice, this list of conditions and the following disclaimer.
96
97 • Redistributions in binary form must reproduce the above copyright
98 notice, this list of conditions and the following disclaimer in the
99 documentation and/or other materials provided with the
100 distribution.
101
102 • Neither the name of Red Hat nor the names of its contributors may
103 be used to endorse or promote products derived from this software
104 without specific prior written permission.
105
106 THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
107 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
108 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
109 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
110 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
111 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
112 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
113 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
114 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
115 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
116 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
117
118
119
120nbdkit-1.25.8 2021-05-25 nbdkit-sparse-random-plugin(1)