1nbdkit-pattern-plugin(1) NBDKIT nbdkit-pattern-plugin(1)
2
3
4
6 nbdkit-pattern-plugin - plugin to serve a fixed pattern of data for
7 testing
8
10 nbdkit pattern [size=]SIZE
11
13 "nbdkit-pattern-plugin" is a plugin for nbdkit(1) which serves a fixed
14 pattern of data, read only. This is used for testing nbdkit filters
15 and NBD clients. To create test disks filled with other repeated
16 patterns use nbdkit-data-plugin(1) or nbdkit-ones-plugin(1) instead.
17
18 The fixed pattern is the offset, as a 64 bit big endian integer, every
19 8 bytes. In hexadecimal this looks like:
20
21 offset data
22 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08
23 0010: 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 18
24 0020: 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 28
25 ↗ └──────────┬──────────┘
26 byte at offset 0x28 │
27 │
28 64 bit big endian int
29 encoding offset 0x28
30
31 The size of the virtual disk must be specified using the "size"
32 parameter. If the size is not a multiple of 8 then the last 8 byte
33 offset in the pattern is truncated.
34
35 Largest possible size
36 nbdkit itself limits plugins to 2⁶³-1 bytes
37 (decimal: 9223372036854775807, hexadecimal: 0x7fff_ffff_ffff_ffff).
38
39 To test if NBD clients are free of bugs (not to mention nbdkit itself)
40 you can use:
41
42 nbdkit pattern 9223372036854775807
43
44 Note this is too large for qemu to open.
45
46 Little endian pattern
47 To get a little endian pattern instead of big endian apply
48 nbdkit-swab-filter(1) on top of this plugin:
49
50 nbdkit pattern 1G --filter=swab swab-bits=64
51
53 [size=]SIZE
54 Specify the virtual size of the disk image.
55
56 This parameter is required.
57
58 "size=" is a magic config key and may be omitted in most cases.
59 See "Magic parameters" in nbdkit(1).
60
62 $plugindir/nbdkit-pattern-plugin.so
63 The plugin.
64
65 Use "nbdkit --dump-config" to find the location of $plugindir.
66
68 "nbdkit-pattern-plugin" first appeared in nbdkit 1.6.
69
71 nbdkit(1), nbdkit-plugin(3), nbdkit-data-plugin(1),
72 nbdkit-full-plugin(1), nbdkit-null-plugin(1), nbdkit-ones-plugin(1),
73 nbdkit-offset-filter(1), nbdkit-random-plugin(1),
74 nbdkit-sparse-random-plugin(1), nbdkit-swab-filter(1),
75 nbdkit-zero-plugin(1).
76
78 Richard W.M. Jones
79
81 Copyright Red Hat
82
84 Redistribution and use in source and binary forms, with or without
85 modification, are permitted provided that the following conditions are
86 met:
87
88 • Redistributions of source code must retain the above copyright
89 notice, this list of conditions and the following disclaimer.
90
91 • Redistributions in binary form must reproduce the above copyright
92 notice, this list of conditions and the following disclaimer in the
93 documentation and/or other materials provided with the
94 distribution.
95
96 • Neither the name of Red Hat nor the names of its contributors may
97 be used to endorse or promote products derived from this software
98 without specific prior written permission.
99
100 THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
101 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
102 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
103 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
104 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
105 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
106 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
107 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
108 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
109 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
110 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
111
112
113
114nbdkit-1.36.2 2023-11-26 nbdkit-pattern-plugin(1)