.\" Automatically generated by Podwrapper::Man 1.10.3 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "nbdkit-data-plugin 1" .TH nbdkit-data-plugin 1 "2019-01-26" "nbdkit-1.10.3" "NBDKIT" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" nbdkit\-data\-plugin \- nbdkit plugin for serving data from the command line .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& nbdkit data data="0 1 2 3 @0x1fe 0x55 0xaa" [size=size] \& \& nbdkit data base64="aGVsbG8gbmJka2l0IHVzZXI=" [size=size] \& \& nbdkit data raw="binary_data" [size=size] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`nbdkit\-data\-plugin\*(C'\fR is a plugin for \fBnbdkit\fR\|(1) which serves a small amount of data specified directly on the command line. The plugin gets its name from the \f(CW\*(C`data:\*(C'\fR \s-1URI\s0 scheme used by web browsers. This is mainly useful for testing \s-1NBD\s0 clients. .PP You can serve data read-only using the \fI\-r\fR flag, or read-write. Any writes are thrown away when nbdkit exits. .PP Most operating systems have command line size limits which are quite a lot smaller than any desirable disk image, so specifying a large, fully populated disk image on the command line would not be possible. However you can specify a small amount of data at the beginning of the image, possibly followed by zeroes (using the \f(CW\*(C`size\*(C'\fR parameter to pad the image to the full size), or use the \f(CW\*(C`data\*(C'\fR parameter creatively to make mostly sparse disk images. .PP The \f(CW\*(C`size\*(C'\fR parameter can specify any virtual size up to the maximum supported by nbdkit (2⁶³\-1 bytes). .SH "EXAMPLES" .IX Header "EXAMPLES" .IP "Create a 1 \s-1MB\s0 empty disk:" 4 .IX Item "Create a 1 MB empty disk:" .Vb 1 \& nbdkit data raw= size=1M .Ve .Sp (This is a contrived example, it is better to use \&\fBnbdkit\-memory\-plugin\fR\|(1) for real applications.) .IP "Create a 1 \s-1MB\s0 disk with some nonsense data at the beginning:" 4 .IX Item "Create a 1 MB disk with some nonsense data at the beginning:" .Vb 1 \& nbdkit data base64=MTIz size=1M .Ve .Sp The above command serves the bytes \f(CW\*(C`0x31 0x32 0x33\*(C'\fR (which is the base64 decoding of \f(CW\*(C`MTIz\*(C'\fR), followed by 1M \- 3 bytes of zeroes. .IP "Create a 1 \s-1MB\s0 disk with one empty MBR-formatted partition:" 4 .IX Item "Create a 1 MB disk with one empty MBR-formatted partition:" .Vb 4 \& nbdkit data data=" \& @0x1b8 178 190 207 221 0 0 0 0 2 0 131 32 32 0 1 0 0 0 255 7 \& @0x1fe 85 170 \& " size=1048576 .Ve .Sp This example was created by running: .Sp .Vb 6 \& $ rm \-f disk \& $ truncate \-s 1M disk \& $ echo start=1 | sfdisk disk \& Device Boot Start End Sectors Size Id Type \& disk1 1 2047 2047 1023.5K 83 Linux \& $ ./disk2data.pl disk .Ve .Sp The \f(CW\*(C`disk2data.pl\*(C'\fR script is provided in the nbdkit sources (https://github.com/libguestfs/nbdkit/blob/master/plugins/data/disk2data.pl). .IP "Create a disk with a partition from another file:" 4 .IX Item "Create a disk with a partition from another file:" .Vb 5 \& nbdkit data data=" \& @0x1b8 178 190 207 221 0 0 0 0 2 0 131 32 32 0 1 0 0 0 255 7 \& @0x1fe 85 170 \& @0x200