.\" Automatically generated by Podwrapper::Man 1.24.1 (Pod::Simple 3.40) .\" .\" 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 1" .TH nbdkit 1 "2021-01-20" "nbdkit-1.24.1" "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 \- toolkit for creating NBD servers .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 10 \& nbdkit [\-D|\-\-debug PLUGIN|FILTER|nbdkit.FLAG=N] \& [\-e|\-\-exportname EXPORTNAME] [\-\-exit\-with\-parent] \& [\-\-filter FILTER ...] [\-f|\-\-foreground] \& [\-g|\-\-group GROUP] [\-i|\-\-ipaddr IPADDR] \& [\-\-log stderr|syslog|null] \& [\-n|\-\-newstyle] [\-\-mask\-handshake MASK] [\-\-no\-sr] [\-o|\-\-oldstyle] \& [\-P|\-\-pidfile PIDFILE] \& [\-p|\-\-port PORT] [\-r|\-\-readonly] \& [\-\-run CMD] [\-s|\-\-single] [\-\-selinux\-label LABEL] [\-\-swap] \& [\-t|\-\-threads THREADS] \& [\-\-tls off|on|require] \& [\-\-tls\-certificates /path/to/certificates] \& [\-\-tls\-psk /path/to/pskfile] [\-\-tls\-verify\-peer] \& [\-U|\-\-unix SOCKET] [\-u|\-\-user USER] \& [\-v|\-\-verbose] [\-V|\-\-version] [\-\-vsock] \& PLUGIN [[KEY=]VALUE [KEY=VALUE [...]]] \& \& nbdkit \-\-dump\-config \& \& nbdkit PLUGIN \-\-dump\-plugin \& \& nbdkit \-\-help .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Network Block Device (\s-1NBD\s0) is a network protocol for accessing block devices over the network. Block devices are hard disks and things that behave like hard disks such as disk images and virtual machines. .PP nbdkit is both a toolkit for creating \s-1NBD\s0 servers from “unconventional” sources, and the name of an \s-1NBD\s0 server. nbdkit ships with many plugins for performing common tasks like serving local files. .SS "Plugins and filters" .IX Subsection "Plugins and filters" nbdkit is different from other \s-1NBD\s0 servers because you can easily create new Network Block Device sources by writing a few glue functions, possibly in C, or perhaps in a high level language like Perl or Python. The liberal licensing of nbdkit is meant to allow you to link nbdkit with proprietary libraries or to include nbdkit in proprietary code. .PP If you want to write your own nbdkit plugin you should read \&\fBnbdkit\-plugin\fR\|(3). .PP nbdkit also has a concept of filters which can be layered on top of plugins. Several filters are provided with nbdkit and if you want to write your own you should read \fBnbdkit\-filter\fR\|(3). .SH "EXAMPLES" .IX Header "EXAMPLES" .SS "Basic file serving" .IX Subsection "Basic file serving" .IP "\(bu" 4 Serve file \fIdisk.img\fR on port 10809 using \fBnbdkit\-file\-plugin\fR\|(1), and connect to it using \fBguestfish\fR\|(1): .Sp .Vb 2 \& nbdkit file disk.img \& guestfish \-\-rw \-\-format=raw \-a nbd://localhost .Ve .IP "\(bu" 4 Serve file \fIdisk.img\fR on port 10809, requiring clients to use encrypted (\s-1TLS\s0) connections: .Sp .Vb 1 \& nbdkit \-\-tls=require file disk.img .Ve .SS "Other nbdkit plugins" .IX Subsection "Other nbdkit plugins" .IP "\(bu" 4 Create a small disk containing test patterns using \&\fBnbdkit\-data\-plugin\fR\|(1): .Sp .Vb 1 \& nbdkit data \*(Aq ( 0x55 0xAA )*2048 \*(Aq .Ve .IP "\(bu" 4 Forward an \s-1NBD\s0 connection to a remote server over \s-1HTTPS\s0 or \s-1SSH\s0 using \&\fBnbdkit\-curl\-plugin\fR\|(1) or \fBnbdkit\-ssh\-plugin\fR\|(1): .Sp .Vb 1 \& nbdkit \-r curl https://example.com/disk.img \& \& nbdkit ssh host=example.com /var/tmp/disk.img .Ve .IP "\(bu" 4 Create a sparse 1 terabyte \s-1RAM\s0 disk using \fBnbdkit\-memory\-plugin\fR\|(1) and use it as a loop device (\fBnbdkit\-loop\fR\|(1)): .Sp .Vb 2 \& nbdkit memory 1T \& nbd\-client \-b 512 localhost /dev/nbd0 .Ve .IP "\(bu" 4 Create a floppy disk image containing files from a local directory using \fBnbdkit\-floppy\-plugin\fR\|(1): .Sp .Vb 1 \& nbdkit floppy dir/ .Ve .SS "Combining plugins and filters" .IX Subsection "Combining plugins and filters" .IP "\(bu" 4 Serve only the first partition from compressed disk image \&\fIdisk.img.xz\fR, combining \fBnbdkit\-partition\-filter\fR\|(1), \&\fBnbdkit\-xz\-filter\fR\|(1) and \fBnbdkit\-file\-plugin\fR\|(1). .Sp .Vb 1 \& nbdkit \-\-filter=partition \-\-filter=xz file disk.img.xz partition=1 .Ve .Sp To understand this command line: .Sp .Vb 9 \& plugin name and plugin parameter \& │ \& ┌───────┴──────┐ \& │ │ \& nbdkit \-\-filter=partition \-\-filter=xz file disk.img.xz partition=1 \& │ │ │ \& └──────────────┴────┬─────────────────────┘ \& │ \& filters and filter parameter .Ve .IP "\(bu" 4 Create a scratch, empty nbdkit device and inject errors and delays, for testing clients, using \fBnbdkit\-memory\-plugin\fR\|(1), \&\fBnbdkit\-error\-filter\fR\|(1) and \fBnbdkit\-delay\-filter\fR\|(1): .Sp .Vb 2 \& nbdkit \-\-filter=error \-\-filter=delay memory 100M \e \& error\-rate=10% rdelay=1 wdelay=1 .Ve .SS "Writing plugins in shell script" .IX Subsection "Writing plugins in shell script" .IP "\(bu" 4 Write a simple, custom plugin in shell script using \&\fBnbdkit\-sh\-plugin\fR\|(3): .Sp .Vb 7 \& nbdkit sh \- <<\*(AqEOF\*(Aq \& case "$1" in \& get_size) echo 1M ;; \& pread) dd if=/dev/zero count=$3 iflag=count_bytes ;; \& *) exit 2 ;; \& esac \& EOF .Ve .IP "\(bu" 4 The same example as above can be written entirely on the command line using \fBnbdkit\-eval\-plugin\fR\|(1): .Sp .Vb 2 \& nbdkit eval get_size=\*(Aqecho 1M\*(Aq \e \& pread=\*(Aqdd if=/dev/zero count=$3 iflag=count_bytes\*(Aq .Ve .SS "Display information" .IX Subsection "Display information" Display information about nbdkit or a specific plugin: .PP .Vb 5 \& nbdkit \-\-help \& nbdkit \-\-version \& nbdkit \-\-dump\-config \& nbdkit example1 \-\-help \& nbdkit example1 \-\-dump\-plugin .Ve .SH "GLOBAL OPTIONS" .IX Header "GLOBAL OPTIONS" .IP "\fB\-\-help\fR" 4 .IX Item "--help" Display brief command line usage information and exit. .IP "\fB\-D\fR \s-1PLUGIN\s0.FLAG=N" 4 .IX Item "-D PLUGIN.FLAG=N" .PD 0 .IP "\fB\-D\fR \s-1FILTER\s0.FLAG=N" 4 .IX Item "-D FILTER.FLAG=N" .IP "\fB\-\-debug\fR \s-1PLUGIN\s0.FLAG=N" 4 .IX Item "--debug PLUGIN.FLAG=N" .IP "\fB\-\-debug\fR \s-1FILTER\s0.FLAG=N" 4 .IX Item "--debug FILTER.FLAG=N" .PD Set the plugin or filter Debug Flag called \f(CW\*(C`FLAG\*(C'\fR to the integer value \f(CW\*(C`N\*(C'\fR. See \*(L"Debug Flags\*(R" in \fBnbdkit\-plugin\fR\|(3). .IP "\fB\-D\fR nbdkit.FLAG=N" 4 .IX Item "-D nbdkit.FLAG=N" .PD 0 .IP "\fB\-\-debug\fR nbdkit.FLAG=N" 4 .IX Item "--debug nbdkit.FLAG=N" .PD (nbdkit ≥ 1.18) .Sp Set the nbdkit server Debug Flag called \f(CW\*(C`FLAG\*(C'\fR to the integer value \&\f(CW\*(C`N\*(C'\fR. See \*(L"\s-1SERVER DEBUG FLAGS\*(R"\s0 below. .IP "\fB\-\-dump\-config\fR" 4 .IX Item "--dump-config" Dump out the compile-time configuration values and exit. See \fBnbdkit\-probing\fR\|(1). .IP "\fB\-\-dump\-plugin\fR" 4 .IX Item "--dump-plugin" Dump out information about the plugin and exit. See \fBnbdkit\-probing\fR\|(1). .IP "\fB\-\-exit\-with\-parent\fR" 4 .IX Item "--exit-with-parent" If the parent process exits, we exit. This can be used to avoid complicated cleanup or orphaned nbdkit processes. There are some important caveats with this, see \*(L"\s-1EXIT WITH PARENT\*(R"\s0 in \fBnbdkit\-captive\fR\|(1). .Sp An alternative to this is \*(L"\s-1CAPTIVE NBDKIT\*(R"\s0 in \fBnbdkit\-captive\fR\|(1). .Sp This option implies \fI\-\-foreground\fR. .IP "\fB\-e\fR \s-1EXPORTNAME\s0" 4 .IX Item "-e EXPORTNAME" .PD 0 .IP "\fB\-\-export\fR \s-1EXPORTNAME\s0" 4 .IX Item "--export EXPORTNAME" .IP "\fB\-\-export\-name\fR \s-1EXPORTNAME\s0" 4 .IX Item "--export-name EXPORTNAME" .IP "\fB\-\-exportname\fR \s-1EXPORTNAME\s0" 4 .IX Item "--exportname EXPORTNAME" .PD Set a preferred exportname to expose in the shell environment created during \fB\-\-run\fR. The use of this option without \fB\-\-run\fR has no effect. This option does \fInot\fR change what nbdkit advertises as a server, but can aid in writing a captive client that wants to access particular content from a plugin that differentiates content based on the client's choice of export name. .Sp If not set, the \fB\-\-run\fR environment is set to access the default exportname \f(CW""\fR (empty string). .IP "\fB\-f\fR" 4 .IX Item "-f" .PD 0 .IP "\fB\-\-foreground\fR" 4 .IX Item "--foreground" .IP "\fB\-\-no\-fork\fR" 4 .IX Item "--no-fork" .PD \&\fIDon't\fR fork into the background. .IP "\fB\-\-filter\fR \s-1FILTER\s0" 4 .IX Item "--filter FILTER" Add a filter before the plugin. This option may be given one or more times to stack filters in front of the plugin. They are processed in the order they appear on the command line. See \*(L"\s-1FILTERS\*(R"\s0 and \&\fBnbdkit\-filter\fR\|(3). .IP "\fB\-g\fR \s-1GROUP\s0" 4 .IX Item "-g GROUP" .PD 0 .IP "\fB\-\-group\fR \s-1GROUP\s0" 4 .IX Item "--group GROUP" .PD Change group to \f(CW\*(C`GROUP\*(C'\fR after starting up. A group name or numeric group \s-1ID\s0 can be used. .Sp The server needs sufficient permissions to be able to do this. Normally this would mean starting the server up as root. .Sp See also \fI\-u\fR. .IP "\fB\-i\fR \s-1IPADDR\s0" 4 .IX Item "-i IPADDR" .PD 0 .IP "\fB\-\-ip\-addr\fR \s-1IPADDR\s0" 4 .IX Item "--ip-addr IPADDR" .IP "\fB\-\-ipaddr\fR \s-1IPADDR\s0" 4 .IX Item "--ipaddr IPADDR" .PD Listen on the specified interface. The default is to listen on all interfaces. See also \fI\-p\fR. .IP "\fB\-\-log=stderr\fR" 4 .IX Item "--log=stderr" .PD 0 .IP "\fB\-\-log=syslog\fR" 4 .IX Item "--log=syslog" .IP "\fB\-\-log=null\fR" 4 .IX Item "--log=null" .PD Send error messages to standard error (\fI\-\-log=stderr\fR), or to the system log (\fI\-\-log=syslog\fR), or discard them completely (\fI\-\-log=null\fR, not recommended for normal use). .Sp The default is to send error messages to stderr, unless nbdkit forks into the background in which case they are sent to syslog. .Sp For more details see \*(L"\s-1LOGGING\*(R"\s0 in \fBnbdkit\-service\fR\|(1). .IP "\fB\-n\fR" 4 .IX Item "-n" .PD 0 .IP "\fB\-\-new\-style\fR" 4 .IX Item "--new-style" .IP "\fB\-\-newstyle\fR" 4 .IX Item "--newstyle" .PD Use the newstyle \s-1NBD\s0 protocol. This is the default in nbdkit ≥ 1.3. In earlier versions the default was oldstyle. See \fBnbdkit\-protocol\fR\|(1). .IP "\fB\-\-no\-sr\fR" 4 .IX Item "--no-sr" Do not advertise structured replies. A client must request structured replies to take advantage of block status and potential sparse reads; however, as structured reads are not a mandatory part of the newstyle \&\s-1NBD\s0 protocol, this option can be used to debug client fallbacks for dealing with older servers. See \fBnbdkit\-protocol\fR\|(1). .IP "\fB\-o\fR" 4 .IX Item "-o" .PD 0 .IP "\fB\-\-old\-style\fR" 4 .IX Item "--old-style" .IP "\fB\-\-oldstyle\fR" 4 .IX Item "--oldstyle" .PD Use the oldstyle \s-1NBD\s0 protocol. This \fIwas\fR the default in nbdkit ≤ 1.2, but now the default is newstyle. Note this is incompatible with newer features such as export names and \s-1TLS.\s0 See \fBnbdkit\-protocol\fR\|(1). .IP "\fB\-P\fR \s-1PIDFILE\s0" 4 .IX Item "-P PIDFILE" .PD 0 .IP "\fB\-\-pid\-file\fR \s-1PIDFILE\s0" 4 .IX Item "--pid-file PIDFILE" .IP "\fB\-\-pidfile\fR \s-1PIDFILE\s0" 4 .IX Item "--pidfile PIDFILE" .PD Write \f(CW\*(C`PIDFILE\*(C'\fR (containing the process \s-1ID\s0 of the server) after nbdkit becomes ready to accept connections. .Sp If the file already exists, it is overwritten. nbdkit \fIdoes not\fR delete the file when it exits. .IP "\fB\-p\fR \s-1PORT\s0" 4 .IX Item "-p PORT" .PD 0 .IP "\fB\-\-port\fR \s-1PORT\s0" 4 .IX Item "--port PORT" .PD Change the \s-1TCP/IP\s0 port number on which nbdkit serves requests. The default is \f(CW10809\fR. See also \fI\-i\fR. .IP "\fB\-r\fR" 4 .IX Item "-r" .PD 0 .IP "\fB\-\-read\-only\fR" 4 .IX Item "--read-only" .IP "\fB\-\-readonly\fR" 4 .IX Item "--readonly" .PD The export will be read-only. If a client writes, then it will get an error. .Sp Note that some plugins inherently don't support writes. With those plugins the \fI\-r\fR option is added implicitly. .Sp \&\fBnbdkit\-cow\-filter\fR\|(1) can be placed over read-only plugins to provide copy-on-write (or \*(L"snapshot\*(R") functionality. If you are using qemu as a client then it also supports snapshots. .IP "\fB\-\-run\fR \s-1CMD\s0" 4 .IX Item "--run CMD" Run nbdkit as a captive subprocess of \f(CW\*(C`CMD\*(C'\fR. When \f(CW\*(C`CMD\*(C'\fR exits, nbdkit is killed. See \*(L"\s-1CAPTIVE NBDKIT\*(R"\s0 in \fBnbdkit\-captive\fR\|(1). .Sp This option implies \fI\-\-foreground\fR. .IP "\fB\-s\fR" 4 .IX Item "-s" .PD 0 .IP "\fB\-\-single\fR" 4 .IX Item "--single" .IP "\fB\-\-stdin\fR" 4 .IX Item "--stdin" .PD Don't fork. Handle a single \s-1NBD\s0 connection on stdin/stdout. After stdin closes, the server exits. .Sp You can use this option to run nbdkit from inetd or similar superservers; or just for testing; or if you want to run nbdkit in a non-conventional way. Note that if you want to run nbdkit from systemd, then it may be better to use \&\*(L"\s-1SOCKET ACTIVATION\*(R"\s0 in \fBnbdkit\-service\fR\|(1) instead of this option. .Sp This option implies \fI\-\-foreground\fR. .IP "\fB\-\-selinux\-label\fR SOCKET-LABEL" 4 .IX Item "--selinux-label SOCKET-LABEL" Apply the SELinux label \f(CW\*(C`SOCKET\-LABEL\*(C'\fR to the nbdkit listening socket. .Sp The common — perhaps only — use of this option is to allow libvirt guests which are using SELinux and sVirt confinement to access nbdkit Unix domain sockets: .Sp .Vb 1 \& nbdkit \-\-selinux\-label system_u:object_r:svirt_t:s0 ... .Ve .IP "\fB\-\-swap\fR" 4 .IX Item "--swap" (nbdkit ≥ 1.18) .Sp Specifies that the \s-1NBD\s0 device will be used as swap space loop mounted on the same machine which is running nbdkit. To avoid deadlocks this locks the whole nbdkit process into memory using \fBmlockall\fR\|(2). This may require additional permissions, such as starting the server as root or raising the \f(CW\*(C`RLIMIT_MEMLOCK\*(C'\fR (\fBulimit\fR\|(1) \fI\-l\fR) limit on the process. .IP "\fB\-t\fR \s-1THREADS\s0" 4 .IX Item "-t THREADS" .PD 0 .IP "\fB\-\-threads\fR \s-1THREADS\s0" 4 .IX Item "--threads THREADS" .PD Set the number of threads to be used per connection, which in turn controls the number of outstanding requests that can be processed at once. Only matters for plugins with thread_model=parallel (where it defaults to 16). To force serialized behavior (useful if the client is not prepared for out-of-order responses), set this to 1. .IP "\fB\-\-tls=off\fR" 4 .IX Item "--tls=off" .PD 0 .IP "\fB\-\-tls=on\fR" 4 .IX Item "--tls=on" .IP "\fB\-\-tls=require\fR" 4 .IX Item "--tls=require" .PD Disable, enable or require \s-1TLS\s0 (authentication and encryption support). See \fBnbdkit\-tls\fR\|(1). .IP "\fB\-\-tls\-certificates\fR /path/to/certificates" 4 .IX Item "--tls-certificates /path/to/certificates" Set the path to the \s-1TLS\s0 certificates directory. If not specified, some built-in paths are checked. See \fBnbdkit\-tls\fR\|(1) for more details. .IP "\fB\-\-tls\-psk\fR /path/to/pskfile" 4 .IX Item "--tls-psk /path/to/pskfile" Set the path to the pre-shared keys (\s-1PSK\s0) file. If used, this overrides certificate authentication. There is no built-in path. See \&\fBnbdkit\-tls\fR\|(1) for more details. .IP "\fB\-\-tls\-verify\-peer\fR" 4 .IX Item "--tls-verify-peer" Enables \s-1TLS\s0 client certificate verification. The default is \fInot\fR to check the client's certificate. .IP "\fB\-U\fR \s-1SOCKET\s0" 4 .IX Item "-U SOCKET" .PD 0 .IP "\fB\-\-unix\fR \s-1SOCKET\s0" 4 .IX Item "--unix SOCKET" .IP "\fB\-U \-\fR" 4 .IX Item "-U -" .IP "\fB\-\-unix \-\fR" 4 .IX Item "--unix -" .PD Accept connections on the Unix domain socket \f(CW\*(C`SOCKET\*(C'\fR (which is a path). .Sp nbdkit creates this socket, but it will probably have incorrect permissions (too permissive). If it is a problem that some unauthorized user could connect to this socket between the time that nbdkit starts up and the authorized user connects, then put the socket into a directory that has restrictive permissions. .Sp nbdkit does \fBnot\fR delete the socket file when it exits. The caller should delete the socket file after use (else if you try to start nbdkit up again you will get an \f(CW\*(C`Address already in use\*(C'\fR error). .Sp If the socket name is \fI\-\fR then nbdkit generates a randomly named private socket. This is useful with \*(L"\s-1CAPTIVE NBDKIT\*(R"\s0 in \fBnbdkit\-captive\fR\|(1). .IP "\fB\-u\fR \s-1USER\s0" 4 .IX Item "-u USER" .PD 0 .IP "\fB\-\-user\fR \s-1USER\s0" 4 .IX Item "--user USER" .PD Change user to \f(CW\*(C`USER\*(C'\fR after starting up. A user name or numeric user \&\s-1ID\s0 can be used. .Sp The server needs sufficient permissions to be able to do this. Normally this would mean starting the server up as root. .Sp See also \fI\-g\fR. .IP "\fB\-v\fR" 4 .IX Item "-v" .PD 0 .IP "\fB\-\-verbose\fR" 4 .IX Item "--verbose" .PD Enable verbose messages. .Sp It's a good idea to use \fI\-f\fR as well so the process does not fork into the background (but not required). .IP "\fB\-V\fR" 4 .IX Item "-V" .PD 0 .IP "\fB\-\-version\fR" 4 .IX Item "--version" .PD Print the version number of nbdkit and exit. .Sp The \fI\-\-dump\-config\fR option provides separate major and minor numbers and may be easier to parse from shell scripts. .IP "\fB\-\-vsock\fR" 4 .IX Item "--vsock" (nbdkit ≥ 1.16) .Sp Use the \s-1AF_VSOCK\s0 protocol (instead of \s-1TCP/IP\s0). You must use this in conjunction with \fI\-p\fR/\fI\-\-port\fR. See \*(L"\s-1AF_VSOCK\*(R"\s0 in \fBnbdkit\-service\fR\|(1). .SH "PLUGIN NAME" .IX Header "PLUGIN NAME" You can give the full path to the plugin, like this: .PP .Vb 1 \& nbdkit $libdir/nbdkit/plugins/nbdkit\-file\-plugin.so [...] .Ve .PP but it is usually more convenient to use this equivalent syntax: .PP .Vb 1 \& nbdkit file [...] .Ve .PP \&\f(CW$libdir\fR is set at compile time. To print it out, do: .PP .Vb 1 \& nbdkit \-\-dump\-config .Ve .SH "PLUGIN CONFIGURATION" .IX Header "PLUGIN CONFIGURATION" After specifying the plugin name you can (optionally, it depends on the plugin) give plugin configuration on the command line in the form of \f(CW\*(C`key=value\*(C'\fR. For example: .PP .Vb 1 \& nbdkit file file=disk.img .Ve .PP To list all the options supported by a plugin, do: .PP .Vb 1 \& nbdkit \-\-help file .Ve .PP To dump information about a plugin, do: .PP .Vb 1 \& nbdkit file \-\-dump\-plugin .Ve .SS "Magic parameters" .IX Subsection "Magic parameters" Some plugins declare a special \*(L"magic config key\*(R". This is a key which is assumed if no \f(CW\*(C`key=\*(C'\fR part is present. For example: .PP .Vb 1 \& nbdkit file disk.img .Ve .PP is assumed to be \f(CW\*(C`file=disk.img\*(C'\fR because the file plugin declares \&\f(CW\*(C`file\*(C'\fR as its magic config key. There can be ambiguity in the parsing of magic config keys if the value might look like a \&\f(CW\*(C`key=value\*(C'\fR. If there could be ambiguity then modify the value, eg. by prefixing it with \f(CW\*(C`./\*(C'\fR .PP There is also a special exception for plugins which do not declare a magic config key, but where the first plugin argument does not contain an \f(CW\*(Aq=\*(Aq\fR character: it is assumed to be \f(CW\*(C`script=value\*(C'\fR. This is used by scripting language plugins: .PP .Vb 1 \& nbdkit perl foo.pl [args...] .Ve .PP has the same meaning as: .PP .Vb 1 \& nbdkit perl script=foo.pl [args...] .Ve .SS "Shebang scripts" .IX Subsection "Shebang scripts" You can use \f(CW\*(C`#!\*(C'\fR to run nbdkit plugins written in most scripting languages. The file should be executable. For example: .PP .Vb 4 \& #!/usr/sbin/nbdkit perl \& sub open { \& # etc \& } .Ve .PP (see \fBnbdkit\-perl\-plugin\fR\|(3) for a full example). .SH "SERVER DEBUG FLAGS" .IX Header "SERVER DEBUG FLAGS" As well as enabling or disabling debugging in the server using \&\fI\-\-verbose\fR you can control extra debugging in the server using the \&\f(CW\*(C`\-D nbdkit.*\*(C'\fR flags listed in this section. Note these flags are an internal implementation detail of the server and may be changed or removed at any time in the future. .IP "\fB\-D nbdkit.backend.controlpath=0\fR" 4 .IX Item "-D nbdkit.backend.controlpath=0" .PD 0 .IP "\fB\-D nbdkit.backend.controlpath=1\fR" 4 .IX Item "-D nbdkit.backend.controlpath=1" .IP "\fB\-D nbdkit.backend.datapath=0\fR" 4 .IX Item "-D nbdkit.backend.datapath=0" .IP "\fB\-D nbdkit.backend.datapath=1\fR" 4 .IX Item "-D nbdkit.backend.datapath=1" .PD These flags control the verbosity of nbdkit backend debugging messages (the ones which show every request processed by the server). The default for both settings is \f(CW1\fR (normal debugging) but you can set them to \f(CW0\fR to suppress these messages. .Sp \&\f(CW\*(C`\-D nbdkit.backend.datapath=0\*(C'\fR is the more useful setting which lets you suppress messages about pread, pwrite, zero, trim, etc. commands. When transferring large amounts of data these messages are numerous and not usually very interesting. .Sp \&\f(CW\*(C`\-D nbdkit.backend.controlpath=0\*(C'\fR suppresses the non-datapath commands (config, open, close, can_write, etc.) .IP "\fB\-D nbdkit.tls.log=\fRN" 4 .IX Item "-D nbdkit.tls.log=N" Enable \s-1TLS\s0 logging. \f(CW\*(C`N\*(C'\fR can be in the range 0 (no logging) to 99. See \fBgnutls_global_set_log_level\fR\|(3). .IP "\fB\-D nbdkit.tls.session=1\fR" 4 .IX Item "-D nbdkit.tls.session=1" Print additional information about the \s-1TLS\s0 session, such as the type of authentication and encryption, and client certificate information. .SH "SIGNALS" .IX Header "SIGNALS" nbdkit responds to the following signals: .ie n .IP """SIGINT""" 4 .el .IP "\f(CWSIGINT\fR" 4 .IX Item "SIGINT" .PD 0 .ie n .IP """SIGQUIT""" 4 .el .IP "\f(CWSIGQUIT\fR" 4 .IX Item "SIGQUIT" .ie n .IP """SIGTERM""" 4 .el .IP "\f(CWSIGTERM\fR" 4 .IX Item "SIGTERM" .PD The server exits cleanly. .ie n .IP """SIGPIPE""" 4 .el .IP "\f(CWSIGPIPE\fR" 4 .IX Item "SIGPIPE" This signal is ignored. .SH "ENVIRONMENT VARIABLES" .IX Header "ENVIRONMENT VARIABLES" .ie n .IP """LISTEN_FDS""" 4 .el .IP "\f(CWLISTEN_FDS\fR" 4 .IX Item "LISTEN_FDS" .PD 0 .ie n .IP """LISTEN_PID""" 4 .el .IP "\f(CWLISTEN_PID\fR" 4 .IX Item "LISTEN_PID" .PD If present in the environment when nbdkit starts up, these trigger \&\*(L"\s-1SOCKET ACTIVATION\*(R"\s0 in \fBnbdkit\-service\fR\|(1). .SH "SEE ALSO" .IX Header "SEE ALSO" .SS "Other topics" .IX Subsection "Other topics" \&\fBnbdkit\-captive\fR\|(1) — Run nbdkit under another process and have it reliably cleaned up. .PP \&\fBnbdkit\-client\fR\|(1) — How to mount \s-1NBD\s0 filesystems on a client machine. .PP \&\fBnbdkit\-loop\fR\|(1) — Use nbdkit with the Linux kernel client to create loop devices and loop mounts. .PP \&\fBnbdkit\-probing\fR\|(1) — How to probe for nbdkit configuration and plugins. .PP \&\fBnbdkit\-protocol\fR\|(1) — Which parts of the \s-1NBD\s0 protocol nbdkit supports. .PP \&\fBnbdkit\-security\fR\|(1) — Lists past security issues in nbdkit. .PP \&\fBnbdkit\-service\fR\|(1) — Running nbdkit as a service, and systemd socket activation. .PP \&\fBnbdkit\-tls\fR\|(1) — Authentication and encryption of \s-1NBD\s0 connections (sometimes incorrectly called \*(L"\s-1SSL\*(R"\s0). .SS "Plugins" .IX Subsection "Plugins" \&\fBnbdkit\-cdi\-plugin\fR\|(1), \&\fBnbdkit\-curl\-plugin\fR\|(1), \&\fBnbdkit\-data\-plugin\fR\|(1), \&\fBnbdkit\-eval\-plugin\fR\|(1), \&\fBnbdkit\-example1\-plugin\fR\|(1), \&\fBnbdkit\-example2\-plugin\fR\|(1), \&\fBnbdkit\-example3\-plugin\fR\|(1), \&\fBnbdkit\-example4\-plugin\fR\|(1), \&\fBnbdkit\-file\-plugin\fR\|(1), \&\fBnbdkit\-floppy\-plugin\fR\|(1), \&\fBnbdkit\-full\-plugin\fR\|(1), \&\fBnbdkit\-guestfs\-plugin\fR\|(1), \&\fBnbdkit\-gzip\-plugin\fR\|(1), \&\fBnbdkit\-info\-plugin\fR\|(1), \&\fBnbdkit\-iso\-plugin\fR\|(1), \&\fBnbdkit\-libvirt\-plugin\fR\|(1), \&\fBnbdkit\-linuxdisk\-plugin\fR\|(1), \&\fBnbdkit\-memory\-plugin\fR\|(1), \&\fBnbdkit\-nbd\-plugin\fR\|(1), \&\fBnbdkit\-null\-plugin\fR\|(1), \&\fBnbdkit\-ondemand\-plugin\fR\|(1), \&\fBnbdkit\-partitioning\-plugin\fR\|(1), \&\fBnbdkit\-pattern\-plugin\fR\|(1), \&\fBnbdkit\-random\-plugin\fR\|(1), \&\fBnbdkit\-S3\-plugin\fR\|(1), \&\fBnbdkit\-sparse\-random\-plugin\fR\|(1), \&\fBnbdkit\-split\-plugin\fR\|(1), \&\fBnbdkit\-ssh\-plugin\fR\|(1), \&\fBnbdkit\-streaming\-plugin\fR\|(1), \&\fBnbdkit\-tar\-plugin\fR\|(1), \&\fBnbdkit\-tmpdisk\-plugin\fR\|(1), \&\fBnbdkit\-torrent\-plugin\fR\|(1), \&\fBnbdkit\-vddk\-plugin\fR\|(1), \&\fBnbdkit\-zero\-plugin\fR\|(1) ; \&\fBnbdkit\-cc\-plugin\fR\|(3), \&\fBnbdkit\-golang\-plugin\fR\|(3), \&\fBnbdkit\-lua\-plugin\fR\|(3), \&\fBnbdkit\-ocaml\-plugin\fR\|(3), \&\fBnbdkit\-perl\-plugin\fR\|(3), \&\fBnbdkit\-python\-plugin\fR\|(3), \&\fBnbdkit\-ruby\-plugin\fR\|(3), \&\fBnbdkit\-rust\-plugin\fR\|(3), \&\fBnbdkit\-sh\-plugin\fR\|(3), \&\fBnbdkit\-tcl\-plugin\fR\|(3) \&. .SS "Filters" .IX Subsection "Filters" \&\fBnbdkit\-blocksize\-filter\fR\|(1), \&\fBnbdkit\-cache\-filter\fR\|(1), \&\fBnbdkit\-cacheextents\-filter\fR\|(1), \&\fBnbdkit\-checkwrite\-filter\fR\|(1), \&\fBnbdkit\-cow\-filter\fR\|(1), \&\fBnbdkit\-ddrescue\-filter\fR\|(1), \&\fBnbdkit\-delay\-filter\fR\|(1), \&\fBnbdkit\-error\-filter\fR\|(1), \&\fBnbdkit\-exitlast\-filter\fR\|(1), \&\fBnbdkit\-exitwhen\-filter\fR\|(1), \&\fBnbdkit\-exportname\-filter\fR\|(1), \&\fBnbdkit\-ext2\-filter\fR\|(1), \&\fBnbdkit\-extentlist\-filter\fR\|(1), \&\fBnbdkit\-fua\-filter\fR\|(1), \&\fBnbdkit\-gzip\-filter\fR\|(1), \&\fBnbdkit\-ip\-filter\fR\|(1), \&\fBnbdkit\-limit\-filter\fR\|(1), \&\fBnbdkit\-log\-filter\fR\|(1), \&\fBnbdkit\-nocache\-filter\fR\|(1), \&\fBnbdkit\-noextents\-filter\fR\|(1), \&\fBnbdkit\-nofilter\-filter\fR\|(1), \&\fBnbdkit\-noparallel\-filter\fR\|(1), \&\fBnbdkit\-nozero\-filter\fR\|(1), \&\fBnbdkit\-offset\-filter\fR\|(1), \&\fBnbdkit\-partition\-filter\fR\|(1), \&\fBnbdkit\-pause\-filter\fR\|(1), \&\fBnbdkit\-rate\-filter\fR\|(1), \&\fBnbdkit\-readahead\-filter\fR\|(1), \&\fBnbdkit\-retry\-filter\fR\|(1), \&\fBnbdkit\-stats\-filter\fR\|(1), \&\fBnbdkit\-swab\-filter\fR\|(1), \&\fBnbdkit\-tar\-filter\fR\|(1), \&\fBnbdkit\-tls\-fallback\-filter\fR\|(1), \&\fBnbdkit\-truncate\-filter\fR\|(1), \&\fBnbdkit\-xz\-filter\fR\|(1) \&. .SS "For developers" .IX Subsection "For developers" \&\fBnbdkit\-plugin\fR\|(3), \&\fBnbdkit\-filter\fR\|(3). .SS "Writing plugins in other programming languages" .IX Subsection "Writing plugins in other programming languages" \&\fBnbdkit\-cc\-plugin\fR\|(3), \&\fBnbdkit\-golang\-plugin\fR\|(3), \&\fBnbdkit\-lua\-plugin\fR\|(3), \&\fBnbdkit\-ocaml\-plugin\fR\|(3), \&\fBnbdkit\-perl\-plugin\fR\|(3), \&\fBnbdkit\-python\-plugin\fR\|(3), \&\fBnbdkit\-ruby\-plugin\fR\|(3), \&\fBnbdkit\-rust\-plugin\fR\|(3), \&\fBnbdkit\-sh\-plugin\fR\|(3), \&\fBnbdkit\-tcl\-plugin\fR\|(3) \&. .SS "Release notes for previous releases of nbdkit" .IX Subsection "Release notes for previous releases of nbdkit" \&\fBnbdkit\-release\-notes\-1.4\fR\|(1), \&\fBnbdkit\-release\-notes\-1.6\fR\|(1), \&\fBnbdkit\-release\-notes\-1.8\fR\|(1), \&\fBnbdkit\-release\-notes\-1.10\fR\|(1), \&\fBnbdkit\-release\-notes\-1.12\fR\|(1), \&\fBnbdkit\-release\-notes\-1.14\fR\|(1), \&\fBnbdkit\-release\-notes\-1.16\fR\|(1), \&\fBnbdkit\-release\-notes\-1.18\fR\|(1), \&\fBnbdkit\-release\-notes\-1.20\fR\|(1), \&\fBnbdkit\-release\-notes\-1.22\fR\|(1), \&\fBnbdkit\-release\-notes\-1.24\fR\|(1). .SS "\s-1NBD\s0 clients" .IX Subsection "NBD clients" \&\fBguestfish\fR\|(1), \&\fBlibnbd\fR\|(3), \&\fBnbd\-client\fR\|(1), \&\fBnbdcopy\fR\|(1), \&\fBnbdfuse\fR\|(1), \&\fBnbdinfo\fR\|(1), \&\fBnbdsh\fR\|(1), \&\fBqemu\fR\|(1). .SS "nbdkit links" .IX Subsection "nbdkit links" http://github.com/libguestfs/nbdkit — Source code. .SS "Other \s-1NBD\s0 servers" .IX Subsection "Other NBD servers" \&\fBqemu\-nbd\fR\|(1), \&\fBnbd\-server\fR\|(1), https://bitbucket.org/hirofuchi/xnbd. .SS "Documentation for the \s-1NBD\s0 protocol" .IX Subsection "Documentation for the NBD protocol" https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md, https://nbd.sourceforge.io/. .SS "Similar protocols" .IX Subsection "Similar protocols" https://en.wikipedia.org/wiki/iSCSI, https://en.wikipedia.org/wiki/ATA_over_Ethernet, https://en.wikipedia.org/wiki/Fibre_Channel_over_Ethernet. .SS "Other manual pages of interest" .IX Subsection "Other manual pages of interest" \&\fBgnutls_priority_init\fR\|(3), \&\fBqemu\-img\fR\|(1), \&\fBpsktool\fR\|(1), \&\fBsystemd.socket\fR\|(5). .SH "AUTHORS" .IX Header "AUTHORS" Eric Blake .PP Richard W.M. Jones .PP Yann E. \s-1MORIN\s0 .PP Nir Soffer .PP Pino Toscano .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2013\-2020 Red Hat Inc. .SH "LICENSE" .IX Header "LICENSE" Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: .IP "\(bu" 4 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. .IP "\(bu" 4 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. .IP "\(bu" 4 Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. .PP \&\s-1THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS\s0 ''\s-1AS IS\s0'' \s-1AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\s0 (\s-1INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES\s0; \s-1LOSS OF USE, DATA, OR PROFITS\s0; \s-1OR BUSINESS INTERRUPTION\s0) \s-1HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\s0 (\s-1INCLUDING NEGLIGENCE OR OTHERWISE\s0) \s-1ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\s0