$plugindir/nbdkit-pattern-plugin.so
The plugin.
Use "nbdkit --dump-config" to find the location of $plugindir.
Plugin to serve a fixed pattern of data for testing
nbdkit pattern
[size=]
SIZE
"nbdkit-pattern-plugin" is a plugin for nbdkit(1) which serves a fixed pattern of data, read only. This is used for testing nbdkit filters and NBD clients. To create test disks filled with other repeated patterns use nbdkit-data-plugin(1) or nbdkit-ones-plugin(1) instead.
The fixed pattern is the offset, as a 64 bit big endian integer, every 8 bytes. In hexadecimal this looks like:
offset data0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 080010: 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 180020: 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 28↗ └──────────┬──────────┘byte at offset 0x28 ││64 bit big endian intencoding offset 0x28
The size of the virtual disk must be specified using the "size" parameter. If the size is not a multiple of 8 then the last 8 byte offset in the pattern is truncated.
nbdkit itself limits plugins to 2⁶³-1 bytes (decimal: 9223372036854775807, hexadecimal: 0x7fff_ffff_ffff_ffff).
To test if NBD clients are free of bugs (not to mention nbdkit itself) you can use:
nbdkit pattern 9223372036854775807
Note this is too large for qemu to open.
To get a little endian pattern instead of big endian apply nbdkit-swab-filter(1) on top of this plugin:
nbdkit pattern 1G --filter=swab swab-bits=64
size=]SIZESpecify the virtual size of the disk image.
This parameter is required.
"size=" prefix may be omitted in most cases. See "Magic parameters" in nbdkit(1).
$plugindir/nbdkit-pattern-plugin.so
The plugin.
Use "nbdkit --dump-config" to find the location of $plugindir.
"nbdkit-pattern-plugin" first appeared in nbdkit 1.6.
4 releases since Debian 10 (Buster); the text changed 3 times.